I posted something similar a few months back, with no replies. I'm working on it again, with a slightly different script, so I thought I'd try aain.
The story: I have a bit of javascript that includes an RSS feed into a page. But when the page loads, the rendering hangs up while it waits for the javascript go out and get the RSS feed, so I want to delay the execution of that script.
So I found another bit of JS that is supposed to be a delay/pause thingy. But I can't seem to connect the two together successfully.
> <script language="JavaScript"><!-- > //-- JavaScript code written by Alan Simpson - www.coolnerds.com > //-- Variable below defines how many seconds to wait. > var howManySeconds = 10 > > //--This is the function that pauses, then calls your custom function. > function pause() { > myTimer=setTimeout("whatToDo()",howManySeconds*1000) > } > > //-- This is the function that's executed after the delay time is up. > function whatToDo() { > alert ("Delay time has ended. Any code could be executed at this > point") > } > //--></script> > Finally, add onload="pause()" to your page's <body> tag, as below: > > <body onload="pause()" >
So I tried this combination, without success:
<script language="JavaScript"><!-- //-- JavaScript code written by Alan Simpson - www.coolnerds.com var howManySeconds = 10
function pause() { myTimer=setTimeout("whatToDo()",howManySeconds*1000) }
function whatToDo() { src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Fwww.sdsuniverse.info%2Fnews_rss.ashx%3Fdid%3D80%26cats%3D36%2C&num=3 " } //--></script>
So I assume for the "whatToDO", I need something more or different than the "src=" from the other script. But what?
The original script is placed inline where I want the feed items to appear. SO maybe for the whatToDo I also need some kind of document.write function??
Sign me: Perplexed in San Diego
****************************** 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/
May 14
Ralph Sharp Re: [OT] javascript pause function
May 14, 2009; 11:51
Ralph Sharp
Re: [OT] javascript pause function
May 14
Keith Parks Re: [OT] javascript pause function
May 14, 2009; 13:17
Keith Parks
Re: [OT] javascript pause function
May 14
Ralph Sharp Re: [OT] javascript pause function
May 14, 2009; 13:44
Ralph Sharp
Re: [OT] javascript pause function
May 14
Keith Parks Re: [OT] javascript pause function
May 14, 2009; 14:01
Keith Parks
Re: [OT] javascript pause function
May 14
Ralph Sharp Re: [OT] javascript pause function
May 14, 2009; 14:51
Ralph Sharp
Re: [OT] javascript pause function
May 14
Terri Chicko Re: [OT] javascript pause function
May 14, 2009; 16:29
Terri Chicko
Re: [OT] javascript pause function
May 14
Rick Faaberg Re: [OT] javascript pause function
May 14, 2009; 19:32
Rick Faaberg
Re: [OT] javascript pause function
May 15
Terri Chicko Re: [OT] javascript pause function
May 15, 2009; 08:26
Terri Chicko
Re: [OT] javascript pause function
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!