Forum Moderators: open

Message Too Old, No Replies

How do I ping an external website before redirecting visitor?

         

greeny

3:04 pm on Dec 20, 2009 (gmt 0)

10+ Year Member



hey asyarief can u tell me the full code of this script of urs step by step?

i want to use it plz tell me how its working?

var ImageObject = new Image();
ImageObject.src= "http://myserver.com/pic.jpg";

if(ImageObject.height>0){
// DO SOMETHING HERE
}

?

i want to use ping function before redirecting it to a certain website or give me any other solution plz

whoisgregg

7:26 pm on Dec 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, greeny!

I think you are referring to this older thread about "pinging" an external site with javascript [webmasterworld.com]?

In the block that says "DO SOMETHING HERE" is where you might add some code to redirect the visitor like:

location.href = 'http://www.example.com/';