Page 1 of 1

js newsfeed issue ...

Posted: Fri Mar 18, 2005 10:54 am
by jmueller0823
We have several newsfeed headlines displayed on our homepage.
Each headline displays via a line of code like this:

Code: Select all

<a href=&quote;http://headlines.site.org/users/mysite/link.asp&quote;>
<script src=&quote;http://headlines.site.org/headlines/headline2.js&quote;></script>
Problem
Sometimes the feeds are slow and affect the load time of our page (sometimes the page will hang for minutes).

The solution I envisioned was to take a daily 'snapshot' of a successful feed (wget?) and then display the headlines as static.

That won't work because wget copies the actual js code.

So, what I'm thinking now is this:

1] Display the js files,
2] extract their text links, and
3] use a different method to place it on the page

Perhaps an intermediate step is to write the links to a text file.

Trying to keep this simple... but...

Ideas? Comments?

The obvious fix would be for the newsfeed host to provide a reliable feed. They tell me they have a timeout built in, but I don't see it...

Thanks.

Posted: Fri Mar 18, 2005 11:42 am
by anjanesh
If this is affecting your page then what you can do is have a onload function in the body tag:

Code: Select all

<script type=&quote;javascript/text&quote;>
function showHeadLines()
 {
 	document.write('<scr'+'ipt src=&quote;http://headlines.site.org/headlines/headline2.js&quote;></scr'+'ipt>');
 }
<script>
.
.
<body onload=&quote;showHeadLines()&quote;>
.
.
.
</body>
.
.

Posted: Fri Mar 18, 2005 11:42 am
by infolock
You have already made a post like this in this forum. I am locking this post and moving your last comment on to that page.

viewtopic.php?t=31633&highlight=

Please do not create multiple threads for the same problem.