Current location: Hot Scripts Forums » General Web Coding » JavaScript » detect user browser on JavaScript support?


detect user browser on JavaScript support?

Reply
  #1 (permalink)  
Old 06-15-05, 12:38 AM
torwill torwill is offline
New Member
 
Join Date: Jun 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
detect user browser on JavaScript support?

Hello,

How do I detect if a visitor's browser has enabled JavaScript support?


I searched Google, and found someone used the following,

Code:
<head>
.......
<noscript>
<meta http-equiv="refresh" content="0; URL=url_to_non_js_page">
</noscript>
</head>
but my script can not pass w3.org's HTML validator, it doesn't seem to be the right place to place the above code.

thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-15-05, 03:22 PM
Torbinsky Torbinsky is offline
Newbie Coder
 
Join Date: May 2005
Location: BC, Canada
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Put the <noscript> tags in the body section, works for me that way...

eg:

Code:
<body>
<noscript>
<meta http-equiv="refresh" content="0; URL=url_to_non_js_page">
</noscript>
.............
</body>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-16-05, 10:30 AM
amitroy5 amitroy5 is offline
Newbie Coder
 
Join Date: May 2005
Location: Mizoram, India
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
You can display text in javascript that say, YOU HAVE JAVASCRIPT ENABLED!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-18-05, 05:40 AM
sarat.pediredla sarat.pediredla is offline
Newbie Coder
 
Join Date: Jun 2005
Location: Newcastle upon Tyne UK
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Why would it not be the right place to put a META tag? Or do you mean the <noscript> tag?

Personally, I would rather do it the other way around if you are not sure the browser does not support javascript. I would write something like this into a non JS enabled version of my page

<head>
<script>
window.location.href = "location_of_js_enabled_page"
</script>
</head>

This way, if JS is enabled, the page automatically redirects to a JS enabled page or just fails to the normal web page.
__________________

--------------------------------
Sarat Pediredla
[Writing a lot about nothing]
Blog : Space & Beyond


<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=108865&amp;t=68"><img border="0" alt="Get Firefox!" title="Get Firefox!" src="http://sfx-images.mozilla.org/affiliates/Buttons/88x31/take.gif"/></a>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
browser detect pagetta JavaScript 2 03-28-05 09:21 AM
2 flash websites for sale metamorph General Advertisements 5 01-09-05 11:03 PM
new user javascript mathfxr JavaScript 1 11-26-04 02:05 AM
Trying my nervers...new user to Javascript rshelton JavaScript 5 07-09-04 02:45 PM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 07:02 AM


All times are GMT -5. The time now is 01:29 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.