Emm I started implementing javascript to my web site, but when I came in mind that user agent(browser) can disable running javascripts I was confused Whats the point coding with javascript if site visitor can disable it ...?
I just code few good functions that protects my website, but when I remembered that I can disable javascript via browser it just killed me...
Maybe you know any other languages similar to javascript and that user cannot disable it?
There is no other option. Today's web pages have so much scripting that if a user disabled JavaScript in most cases the site will become unusable for them.
The good news is that the percentage of users running with JavaScript disabled is in the single digits. But best practice is to always code your pages so that they degrade gracefully for users running with JavaScript disabled. This generally means including hard-coded links for navigation (<noscript> sections can help here), and display layouts that default to a usable state. The degree to which you need to accommodate those users will vary widely depending on the audience for the site. A technical site, for example, probably doesn't need to do much more than include a warning in a <noscript> section that the site requires JavaScript to function properly. But a general audience site should insure that all major functions (especially navigation links) work without requiring JavaScript.
<script>
// For sure it must be javascript functions
if ( !isset(cookie['javascript'])
set_cookie('javascript', blablabla, 1second)
else
delete_cookie('javascript')
again_set_cookie('javascript', blablabla, 1second)
</script>
// Check with PHP now
if ( !isset($COOKIE['javascript']) )
echo "Sorry please enable javascript";
exit;
That will be correct for checking if javascript enabled/disabled?
P.S. It is possible somehow for user to add a cookie manually?
You shouldn't rely on validating user input with JavaScript. Validation should happen on the server, because users can always manipulate and execute scripts in their own clients, but they can't control what happens on the server.
Edit: I can also add that users can add/edit cookies. They can also allow JavaScript but block cookies. A server or webpage has no real control over what happens in any client, simply said.
you can disable CSS and images, but most sites still use those technologies.
you can use javascript to redirect the user into an upgraded javascript-enabled version of your site.
Bookmarks