I have a page that uses a bit of inline javascript to drop in a couple of items from an RSS feed.
The problem is that sometimes (more like almost always in my tests so far) the page rendering hangs up half way through waiting for the JS to do its work. I assume it's either waiting for the feed from the RSS server or else waiting on the server that hosts the php script that processes the feed (one of the free ones).
I don't mind the potential delay for the feed items to drop in, if only the rest of the page would render around them.
So I was trying to find a way to delay the execution of the javascript, poking around on various tutorial sites. But what I ended up patching together doesn't work, and I suspect there's a problem with the syntax, but its over my JS head, as it were.
Here's the code. Any ideas? Am I on the right track? (I'm sure I'm supposed to replace "FooEndFunc" with something, but what?)
<script language="JavaScript"
var onFooEndFunc = function() { var delay = 5000; /* milliseconds - vary as desired */ var executionTimer;
return function() { if (executionTimer) { clearTimeout(executionTimer); }
Note: the code above still drops in the feeds, but there's no delay (should be 5 secs in this test.)
Thanks,
Keith
****************************** Keith Parks Graphic Designer/Web Designer Student Affairs Communications Services San Diego State University San Diego, CA 92182-7444 (619) 594-1046 mailto:kparks@mail.sdsu.edu http://www.sa.sdsu.edu/communications
A riddle wrapped in a mystery inside an enigma, served with a side of slaw.
-- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/GoLive/Browse/ Manage your subscription: http://www.ListSearch.com/GoLive/
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!