faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 12 people (8%) answered Yes
Recently 0 of 10 people (0%) answered Yes

Entry

How do i find whether a user is connected to the net by writing a java script?

Apr 5th, 2008 20:24
ha mo, Colin Fraser, sumana gv,


Do you want some way to detect if the user is viewing your page while in
your site? Or do you mean that you want a way to detect if the user is
actually viewing your page from their own hard drive? Simple, maybe and
i am not going to provide you with the code, you can do that yourself. 
In the <body> tag place an onLoad() statement calling a function that
looks for something at a specific location that is not downloadable by
the user. The seach must be on a location that cannot be found on any
user's ccomputer. If the browser cannot get an expected response, then
set a boolean which is used in a second function that displays a message
saying that the browser could not find something therefore the user is
actually off-line.  
Good luck.
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com