Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-23-2006, 11:41 AM   PM User | #1
name _F1
Regular Coder

 
Join Date: Jun 2006
Posts: 225
Thanks: 6
Thanked 3 Times in 3 Posts
name _F1 is on a distinguished road
Going to a "no Javascript" page after pop-up

A page in my website requires a full-screen pop-up. Is the following method a reliable way of redirecting the user to a page where they are informed that Javascript is needed, or is there a better way?
PHP Code:
<!--Link to pop-up-->
<
a href="/nojavascript.php" onclick="window.open('/pop-up.php','_blank')">Open</a
name _F1 is offline   Reply With Quote
Old 10-23-2006, 11:50 AM   PM User | #2
Striker14537
New Coder

 
Join Date: Oct 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Striker14537 is an unknown quantity at this point
I can help ^^
Code:
<head>
<noscript>
<meta http-equiv="refresh" content="0;url=pop-up.php">
</noscript>
<head>
Striker14537 is offline   Reply With Quote
Old 10-23-2006, 12:28 PM   PM User | #3
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
Quote:
Code:
<meta http-equiv="refresh" content="0;url=pop-up.php">
Fwiw, Google frowns upon 0 length meta redirects, due to their popularity amongst spammers and other shysters.

Using noscript elements in the head section will also invalidate the document, at least under some doctypes.

Code:
<a href="/nojavascript.php" onclick="window.open('/pop-up.php','_blank'); return false;">Open</a>
Remember to add return false to prevent the main window from going to the non-js page as well.


You should consider whether or not js is really necessary for viewing the content in the new window? It may be important to those who don't, won't or can't use js.
Bill Posters is offline   Reply With Quote
Old 10-23-2006, 02:56 PM   PM User | #4
name _F1
Regular Coder

 
Join Date: Jun 2006
Posts: 225
Thanks: 6
Thanked 3 Times in 3 Posts
name _F1 is on a distinguished road
Yeah, I forgot the return false. So that is a reliable method for adding a non-Javascript page?

Yes, the content is strictly Javascript required. If the user has Javascript disabled, then the page really doesn't apply to them anyway.

Last edited by name _F1; 10-23-2006 at 03:00 PM..
name _F1 is offline   Reply With Quote
Old 10-23-2006, 04:02 PM   PM User | #5
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
Quote:
Originally Posted by DownStrike View Post
Yeah, I forgot the return false. So that is a reliable method for adding a non-Javascript page?

Yes, the content is strictly Javascript required. If the user has Javascript disabled, then the page really doesn't apply to them anyway.
The method you're currently using is effective, though could be improved upon.
Imho, a better option might be to use js to add the link to the page.
Those with js get (access to) the additional info, whilst those without aren't offered a link which is of no use to them.

Alternatively, you could add some text telling users that js is required for certain info and then use js to turn that text into a link to that extra info.
Non-js users get the message, whilst js users get the link to the info.

Last edited by Bill Posters; 10-23-2006 at 04:04 PM..
Bill Posters is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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 +1. The time now is 10:17 PM.


Advertisement
Log in to turn off these ads.