I am working on a web application.While I am considering that JavaScript is disabled in the client browser.So How much I consider it.Like I have used many times JQuery in My Project.If javaScript is disabled then this code is not working?
I don’t know the numbers (percentage of users who disable JavaScript), but it should always be taken into consideration.
If the application is heavily dependent upon JS, then you might want to figure some kind of alert to let users know that JS is critical to the application.
If the application is NOT heavily dependent upon JS, then it would probably be a good idea to come up with a contingency plan for allowing things to gracefully degrade.
Ideally, yes. I think a lot of that, however, would depend upon how much “flash and wow” you want or need. If you are not as concerned with DOM manipulation and flashy aesthetics, you can do the application with no JavaScript.
But, if you want to be able to submit form data in the background via AJaX, then that makes things slightly more difficult.
Let’s say you are working on a navigation menu. Ok just go here (code funda mentals . com) with / without JS on (broke up the URL to not get called a spammer/blasted by mods.)
Desktop WITHOUT Javascript → Horizontal Menu. Nothing special
Desktop WITH Javascript → You get the added benefit of it being a sticky navigation. Go scroll down and see it follows you. Simple upgrade of UX.
Mobile WITHOUT Javascript → Vertical menu that appears at the top of the page.
Mobile WITH Javascript → I use JS to turn this into a hamburger menu which is much preferred in the mobile web, rather than a silly vertical menu.
Javascript should be used to enhance the user experience of the webpage. Use it responsibly and for features that make the users life better. But also make it so you don’t detract from the functionality of hte page without Javascript. Get a working version of your page without Javascript first, then use JS to increase the UX .
Those tags are long obsolete (the last browser that needed them was Netscape 4). Since then it has been far easier to detect whether JavaScript is enabled or not using JavaScript (as Mittineague illustrates)
I wasn’t trying to sell him on the use of the tag. He asked how StackExchange handled the red banner:
<noscript>
<div id="noscript-warning">Stack Overflow works best with JavaScript enabled<img src="http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno"></div>
</noscript>
noscript is a block level tag so you need to wrap it around an entire paragraph at a minimum. You can use JavaScript and a span tag around as little as a single character and do the same thing.
You can use one line of JavaScript and a CSS class to replace dozens of noscript tags and the corresponding dozens of lines of JavaScript that supply the alternate content.
You can use JavaScript to test for far more than just JavaScript enabled or disabled - you can test for specific commands being available and update the page based on what JavaScript the browser supports .
Basically not using noscript is so much more flexible than using it that only someone who doesn’t know JavaScript properly would even consider using noscript.
HTML 5 did introduce allowing noscript in the head of the page (which was not previously allowed) where you could use it to replace the single line of JavaScript by applying all the changes using CSS instead - but only for JavaScript enabled/disabled, not for any of the thousands of other possibilities you have if you don’t use noscript…