-2

I'm having problems with detecting Javascript. I've created a jQuery Popup window which is working only for users who has javascript enabled. However if their browser has JS disabled, I'd like to redirect them to index.php WHEN they click on the button.

So basically if someone has JS enabled he/she would get the popup window, and if they don't have, they would have been redirected.

Is it possible? Also if would this work on mobile devices aswell?

Taboo Loco
  • 551
  • 3
  • 9
  • 14

2 Answers2

4

There is a meta tag that will allow you to do this, just keep in mind it can't go in the body and needs to be in the head of the document.

<noscript>
    <meta http-equiv="Refresh" content="0; URL=../error/errorjs.jsp" />
</noscript>
OnResolve
  • 4,016
  • 3
  • 28
  • 50
2

This technique is called hijax

Create a link <a href="index.php">..</a>

And attach to it a javascript event that disable the normal flow

If javascript is enabled, it will show the popup, otherwise the link will work as normal..

YardenST
  • 5,119
  • 2
  • 33
  • 54