i was wondering if there was some sort of event triggered when javascript is enabled in a browser (ie. in firefox, tools->options->check off enable javascript-> click ok). i want to redirect a user to a page when this happens. any ideas?
Thanks!
EDIT:
i’ve put an iframe into the page but am not getting the alert (after i enable javascript), so the refresh must not be working. what is wrong with this?
<iframe style="display:none">
<html>
<head>
<title>my iframe</title>
<meta http-equiv="Refresh" content="5" />
<script type="text/javascript">
window.parent.location.href = 'home.php';
alert("HELLO");
</script>
</head>
</html>
</iframe>
You can only detect whether JavaScript is enabled/disabled on page load. There is no event called for it being enabled/disabled after a page has loaded. Only possible solution i can think is to have an invisible iframe in your main page containing a script with a small meta refresh and a check for whether JavaScript is enabled – if it is then redirect the parent(main) page.
so your iframe would include something like this:
jscheck.html
checker.html