14 January, 2013

Check for Javascript enabled

Rather an easy solution, but still elegant. When you want to make sure the client is running with Javascript (and thus JQuery) enabled; you can basically do this using the simple <noscript> tag. Note that the #outerFrame is the entire site (main Div). By using this approach you get an entirely blank site with only the text: “You need to have javascript enabled to use this site. “. The second the user enables Javascript – the site renders normally.


form id="form1" runat="server">
style type="text/css">
#outerFrame {
display: none;
div class="noscriptmsg">
You need to have javascript enabled to use this site.
asp:ScriptManager ID="scrtMgr" runat="server" EnableCdn="true" EnablePartialRendering="true"></asp:ScriptManager>
div id="outerFrame" class="main">
……. (rest is omitted for brewity)

No comments:

InRiver: Not loading your extensions?

(You really need to in the loop to appreciate the issue this post addresses). Man, I've been fighting this problem for hours before I ...