Is there anyway to make a window to popup if javascript disabled?
2 Answers
<noscript>
<style type="text/css">
#body {display:none;}
#alertdiv {display:inline;}
</style>
</noscript>
where #alertdiv is a div designed to show the message you want (hidden by default) and #body the id of your main div that will be hidden if javascript is not activated. But it is optional.
A popup is a window.open command and doesn't exist without javascript. You have to emulate something similar. [update 2015: bootstrap, jquery... now offer wonderful ways of displaying alerts without requiring popups, as easily as $("#alert-box").modal("show");]
The idea is to use CSS to show parts of your page only when javascript is disabled.
Side-note: this won't validate w3c.
Comments
<body>
<div id="NoScriptPopup">Javascript is disabled on your browser</div>
<div id="YourContent">/*Your page content goes here*/</div>
<style>
#YourContent
{
display:none;
}
</style>
<script>
document.getElementById("NoScriptPopup").style.display = 'none';
document.getElementById("YourContent").style.display = 'block';
</script>
</body>
So if javascript is disabled on a browser, the #NoScriptPopup will appear and your content will be hidden. You could style #NoScriptPopup div using css to make it look like a popup.
target="_blank"on an anchor tag to open the link in a new window, there's nothing that will do what you're asking without JavaScript (or equivalent)