homepage Welcome to WebmasterWorld Guest from 54.227.146.68
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
external .JS loading timeout problem
javascrit include js loading timeout problem
aibanez




msg:1487738
 11:33 am on Jun 17, 2003 (gmt 0)

Let's say I have an static HTML page with a .JS include somewhere to an *external file*, located on a different webserver. (This is pretty common on weblog services like allconsuming.net or haloscan.com, where they have personalized .JSs and you basically include your designated .JS on your page)

something like

<script language="javascript"
type="text/javascript" src="http://www.xyz.net/foo.js">
</script>

Let's say it's a pretty small piece of code, like 1K or something, for rendering a small text.

I'm talking here of basic javascript, not having the possibility of using SSI nor anything else. Plain-old-javascript only.

Let's say the user request your HTML the page and so the script tries to load the external .JS file but there is *any kind of problem* with the server or the connection so the .JS code doesn't arrive for 10, 30 or 60 seconds (or never).

What are the effects on the page from the user point of view? Does anything displays at all if the .JS does not load? Depends on the browser? (Let's say the .JS is inside a very big table).

Is there any option for changing the "timeout" of this .JS request at all? What is the "standard" time out for a situation like this?

If you need any clarification, please ask.

Thanks in advance,

 

tedster




msg:1487739
 11:32 pm on Jun 17, 2003 (gmt 0)

Let's say the .JS is inside a very big table

Yes, results would depend on the browser, but I doubt it would ever be very graceful. The table (and therefore that page) would hang in many browsers. In other browsers a preliminary rendering of the page might be made, but styles/attributes could not be "finalized" -- and that could mean a screen stuck in a totally WILD layout.

Is there any option for changing the "timeout" of this .JS request
at all? What is the "standard" time out for a situation like this?

Some searching uncovered this mention that PHP can modify the browser timeout if a long process needs to run. It's just a glimmer of a possibility for you situation though.

Question :
How do I set the browser timeout?

Answer :
If your script is too complex to finish within
the standard 30 seconds you can set a new value
with the function:

set_time_limit(900);

this sets the timeout too 900 seconds / 15 minutes.

Reference [alt-php-faq.org]

Sorry I can't be more help on this. Maybe this trip back to the Active List will bring you someone who does.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved