JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 28th, 2001, 08:34 PM
rtaylor rtaylor is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Location: In a multi-cultural mess.
Posts: 569 rtaylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 59 m 30 sec
Reputation Power: 13
How can I tell whether a browser has javascript enabled?

I had posted this to the HTML / JAVASCRIPT forum some weeks ago,
but now decided to try here.

How can I tell whether a browser has javascript enabled?

I want to pop a "help" window in a "new" location so the user
is aware that there are now 2 windows -- the help window
and the "main" window that the help refers to.

To do this, it seems that I must use javascript window.open( ...
How can I tell whether a browser has javascript enabled?

Robert
__________________
Robert
---
If it's hard, it's probably wrong.

Reply With Quote
  #2  
Old August 28th, 2001, 08:55 PM
SilkySmooth's Avatar
SilkySmooth SilkySmooth is offline
Newbie :P
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2001
Location: In the PHP Engine :-)
Posts: 2,880 SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 11 h 40 m 10 sec
Reputation Power: 20
Lightbulb Because it won't work ;-)

Sorry couldn't resist, I'm not sure that there is any way to detect it because a users browser settings I would think are a private thing and were not designed for us to explore.

I could be wrong though.
__________________
---------------------
-- SilkySmooth --
---------------------
Proxy

Reply With Quote
  #3  
Old August 28th, 2001, 10:09 PM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 39 m 5 sec
Reputation Power: 116
First off, you do realize that there is an html href tag property called 'target' that allows you to open links in a new window, right? You have no say over the size of the window, but if it absolutely must be in a new window even if JS is off, use 'target=_blank'.

Having said that, Here is how I make my links using the open function so that I know it will still work with non-JS enabled browsers

Code:
<a href="http://www.clanmisfire.com" target="_blank" 
  onClick='window.open("http://www.clanmisfire.com",
              "",
              "height=750,width=590,resizable=yes,scrollbars=yes");    return false;'>


Now, let me explain what that is doing.

If a browser has JS ENABLED, it first executes the onClick event handler. The function window.open runs, opening a new window. Then the next line, return false;, executes. This keeps the browser from going any farther for this href tag. In other words, it does NOT act like a link and follow the href property.

If a browser has JS DISABLED, it ignores the onClick property and goes straight for the href. It opens the link in a new window anyway. The only thing is that you have no say over what that new window looks like. I think for the small percentage of ppl that have JS turned off, this is acceptable considering they can still get to the content.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > How can I tell whether a browser has javascript enabled?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap