phppaper Posted March 16, 2008 Share Posted March 16, 2008 How do you force people to enable javascript in order to view that page?? Quote Link to comment Share on other sites More sharing options...
nogray Posted March 17, 2008 Share Posted March 17, 2008 In The head section add something like this <noscript><meta http-equiv="refresh" content="0;url=http://yourdomain.com/JS_IS_A_MUST.html"></noscript> This will redirect to JS_IS_A_MUST.html where you can explain why JS must be enabled. Be carefull with this implementation, Seach engines will NOT be able to spider your pages that contain this tag. Quote Link to comment Share on other sites More sharing options...
GameYin Posted March 17, 2008 Share Posted March 17, 2008 Interesting, I've always wanted someone to do that for me. I assume this has to be in head section since a meta? Or would body be fine. Quote Link to comment Share on other sites More sharing options...
nogray Posted March 17, 2008 Share Posted March 17, 2008 body will work, but it won't be a valid html document (for W3C validation) Quote Link to comment Share on other sites More sharing options...
GameYin Posted March 17, 2008 Share Posted March 17, 2008 ALL of the DOc types will conclude it's not valid?? body will work, but it won't be a valid html document (for W3C validation) Head will work...? Quote Link to comment Share on other sites More sharing options...
nogray Posted March 17, 2008 Share Posted March 17, 2008 yeah, head will work. Quote Link to comment Share on other sites More sharing options...
haku Posted March 18, 2008 Share Posted March 18, 2008 I'm of the group that believes firmly that javascript should NEVER be required (with maybe the exception of a chat program). I use javascript extensively in my sites, but I always add it as an extra feature, not a required feature. For example, when creating forms, I will build the whole form and all its validation in PHP, then I will put javascript over top to check the form, and execute the javascript if the user has javascript enabled, with the PHP working as a backup for when javascript is disabled. Another example would be an AJAX slideshow I developed. It has a 'back' and 'next' button under the image being viewed. If javascript is enabled, then the image in the viewer switches to the next image. If javascript is disabled, then the page reloads with the next image in the viewer. When I find a site that explicitly requires javascript, I just shake my head and say 'sloppy programming'. If its not direly necessary for me to use that site, then I don't use it. Quote Link to comment Share on other sites More sharing options...
aximbigfan Posted March 22, 2008 Share Posted March 22, 2008 I'm of the group that believes firmly that javascript should NEVER be required (with maybe the exception of a chat program). I use javascript extensively in my sites, but I always add it as an extra feature, not a required feature. For example, when creating forms, I will build the whole form and all its validation in PHP, then I will put javascript over top to check the form, and execute the javascript if the user has javascript enabled, with the PHP working as a backup for when javascript is disabled. Another example would be an AJAX slideshow I developed. It has a 'back' and 'next' button under the image being viewed. If javascript is enabled, then the image in the viewer switches to the next image. If javascript is disabled, then the page reloads with the next image in the viewer. When I find a site that explicitly requires javascript, I just shake my head and say 'sloppy programming'. If its not direly necessary for me to use that site, then I don't use it. No, I don't think JS is sloppy coding. How do you do AJAX with HTML? There are tons of things that just need JS. Sure, some things can be done with just HTML, but there are tons of applications where JS is needed. Chris Quote Link to comment Share on other sites More sharing options...
haku Posted March 23, 2008 Share Posted March 23, 2008 You didn't properly read what I said. I didn't say AJAX is sloppy programming (I use it extensively). I said AJAX without an HTML backup for people who have javascript turned off is sloppy programming. There is a big difference. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted March 26, 2008 Share Posted March 26, 2008 I'm with haku. You can develop everything to work without Javascript first and then add it in later. Then you get the best of both worlds. To take it a step further, Javascript should not be embedded in your markup either. This gets you a slap on the wrist in my book: <a href="#" onclick="alert('hi');">click</a> Quote Link to comment Share on other sites More sharing options...
haku Posted March 27, 2008 Share Posted March 27, 2008 And I'm with you on that one! All javascript should be external. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.