Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookies and Javascript support 1

Status
Not open for further replies.

r0nke

MIS
Jul 17, 2003
60
0
0
US
Hello

I need to paste a page on my website for folks to test if they have JS and cookies enabled. Kind of like "click here to see if you have JS and cookies enabled".

So I need some kind of code that can run that test.

Any help would be great.

Thanks
 
For the JS, that's dead easy:

Code:
<a href="javascript:alert('You have JavaScript enabled');">Click this link, and if you see no message, you have JavaScript disabled</a>

For the cookies, you'll need to first make sure they have javaScript enabled... then write a cookie, and read it back. If it does not read back, you know they're disabled.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top