Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

external .JS loading timeout problem

javascrit include js loading timeout problem



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

Inactive Member
Account Expired


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">

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,

11:32 pm on June 17, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
votes: 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:


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.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members