Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2006
    Posts
    225
    Thanks
    6
    Thanked 3 Times in 3 Posts

    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

  • #2
    New Coder
    Join Date
    Oct 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can help ^^
    Code:
    <head>
    <noscript>
    <meta http-equiv="refresh" content="0;url=pop-up.php">
    </noscript>
    <head>

  • #3
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Jun 2006
    Posts
    225
    Thanks
    6
    Thanked 3 Times in 3 Posts
    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.

  • #5
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •