Click to See Complete Forum and Search --> : check if Javascript is enabled and take actions


ktsirig
04-11-2006, 05:25 PM
Hi,
I want to add a couple of pop-up boxes in my page, and I want to know :
1) is there a small piece of code that I must paste in my page which will check to see if the client has JS enabled?
2) do I use the <noscript> tag to enter the page that the user with no JS enabled will see?
3) if a user has JS enabled, do I need to check also if there are pop-up blockers, or it will be ok and my pop-up will open with no problem?

What I want basically is:
I have a link in the page ,which, if JS is enabled will open in a pop-up window when the user clicks on it, whereas, if JS is disabled, it will open in a new page, like plain, ordinary links

Thanks in advance

JPnyc
04-11-2006, 05:47 PM
The only way I can think of offhand is to have 2 sets of links, one with target="_blank" and the other with javascript window opener script. Onload you could call a JS function to hide one, and show the other. If there's no JS, it'll do nothing, and you'll get the 2nd thing you said you wanted. If there is JS you'll get the 1st scenario

MarkR
04-12-2006, 07:15 AM
You can make a single link, which opens the page in a new window by using a named target (I wouldn't use _blank myself).

Then have a javascript onclick event which tries to open up a popup, and if successful, returns false from the event handler, which will prevent the original anchor doing anything.

Mark

bogu
04-14-2006, 06:09 AM
....

Edited: sry for posting here, I made a mistake and there is no delete ...