To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-11-2006, 05:25 PM   #1
ktsirig
Member
 
Join Date: Sep 2005
Posts: 47
check if Javascript is enabled and take actions

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
ktsirig is offline   Reply With Quote
Old 04-11-2006, 05:47 PM   #2
JPnyc
Administrator
 
Join Date: Jan 2005
Posts: 963
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
__________________
PHP builder Online Community Manager

JPnyc is offline   Reply With Quote
Old 04-12-2006, 07:15 AM   #3
MarkR
Senior Member
 
Join Date: Jul 2004
Location: Oxford, England
Posts: 1,983
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
MarkR is offline   Reply With Quote
Old 04-14-2006, 06:09 AM   #4
bogu
I code 4 beer ...
 
bogu's Avatar
 
Join Date: Nov 2002
Location: Romania
Posts: 1,743
Plz delete ...

....

Edited: sry for posting here, I made a mistake and there is no delete ...
__________________
/**
* The answer is so obvious, duh!
* It's like, whatever ...
*
* If your problem has been solved, PLEASE click the RESOLVED LINK under "Thread Tools"
*/

Last edited by bogu; 04-14-2006 at 06:12 AM.
bogu is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 01:56 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.