Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Using body onLoad event

..but with reference to external .js script



2:50 pm on Dec 3, 2003 (gmt 0)

10+ Year Member

I have a simple page which creates a form and then immediately posts itself to another page, passing the formatted data across.

This page currently works very well, and I can't really its functionality.

I now need to pass some of the data to a third party site, and I'm aiming to do this by passing the data as parameters in a url. I will make the call to the url by calling an external JavaScript file.

This works fine, and passes the data across without a problem. However, I'm worried that if the third party site goes down, my page will not redirect as the onLoad event will take ages to trigger.

Passing the data is secondary to preventing my site from breaking.

I also considered calling a gif, but then the onLoad will still be waiting... any ideas?


3:16 pm on Dec 3, 2003 (gmt 0)

10+ Year Member

Would this work?

function passParams{
var testImage= new Image();
testImage.onload = function(){//pass the params}
testImage.onerror = function(){//dont pass params }
testImage.src = 'http://testServerAlive.com/theImage.gif';

<BODY onload=passParams() ..


3:18 pm on Dec 3, 2003 (gmt 0)

10+ Year Member

Hmmm... I like it... I'll give it a go.


3:38 pm on Dec 3, 2003 (gmt 0)

10+ Year Member

Looks to be working. Nice one, thanks a lot.

Featured Threads

Hot Threads This Week

Hot Threads This Month