Click to See Complete Forum and Search --> : Check whether online or not


GurusGuru
01-08-2003, 11:54 PM
When a person clicks on a link, the script should check whether the person is online (his internet connection is live). If he is not online or he been disconnected a message should pop up 'To view this feature please go online. You are not connected to internet'. This message should contain 2 links - 'Connect' and 'Do not Connect'. If he clicks on 'connect' button his dial up window should open. If he clicks on 'Do not connect' button the popup alert/window should close and he should remain on the same page.

ShrineDesigns
01-09-2003, 01:14 AM
most of the time this is done automaticly by the user's computer

GurusGuru
01-09-2003, 03:13 AM
In case of links in 'ebooks' it doesn't happen. Normally ebooks are read offline but may have links which retrives the latest data from the net, hence a script as mentioned can be useful.

jalarie
01-17-2003, 09:04 AM
I use the following bit of script to display a green dot if the person is online and a red one otherwise. Maybe you can do something with that:

&nbsp;<script&nbsp;type="text/javascript">
&nbsp;&nbsp;Now=new&nbsp;Date();
&nbsp;&nbsp;Out&nbsp;='<img&nbsp;src="http://myplace.com/gren.gif';
&nbsp;&nbsp;Out+='?'+Now*1;
&nbsp;&nbsp;Out+='"&nbsp;onerror="this.src=\'mine/red.gif\'"/>\n';
&nbsp;&nbsp;document.write(Out);
&nbsp;</script>

GurusGuru
02-07-2003, 04:40 AM
It is a very good idea. If separate URL links can be given to the different images, it would work perfectly. Like if a person is online the green.gif (along with a text in the image format - Click here to continue) will show up with a link to the website. The red button would link to a page in the ebook.

khalidali63
02-07-2003, 07:32 AM
th above hack is mostly used to find out anything about a server
.
and this line
http://myplace.com/gren.gif

will always return false.Because what it does is to see if there is a webserver at this address that serves green.gif.
Since this will not be true,therefore you will always get an error.if you want toestablish that some one has an internet connection then you must point to a resource thats always up for service on a webserver.

I hope it made any sense..:-)

cheers

Khalid

GurusGuru
02-07-2003, 10:31 PM
myplace.com is just an example given by jalarie. It is to be replaced by the url of your website (xyz.com). The idea is to take the person to xyz.com if he is online and if xyz.com is working. If he is offline the red.gif will show with a link to 'mine/goonline.html' which will take him to to the page goonline.html (the contents of the page will say - Either the website xyz.com is down or you are offline etc. etc.)

I not good at scripting but how can I give a link (http://www.xyz.com target=_blank) to the image http://xyz.com/gren.gif.

And another link (mine/goonline.html target=_self) to the image mine/red.gif