Difference between revisions of "JavaScript, Internet Explorer, and Old Web Browsers via Yoast"

m
no edit summary
m
m
Line 9: Line 9:
According to [https://www.w3schools.com/tags/tag_noscript.asp W3Schools], the NoScript Element / Tag is used if a a browser does NOT support JavaScript.  All modern [https://www.w3schools.com/js/js_versions.asp web browsers support JavaScript], so that doesn't really happen these days unless it is purposely disabled via a browser setting or a plugin.  That brings up the obvious question...
According to [https://www.w3schools.com/tags/tag_noscript.asp W3Schools], the NoScript Element / Tag is used if a a browser does NOT support JavaScript.  All modern [https://www.w3schools.com/js/js_versions.asp web browsers support JavaScript], so that doesn't really happen these days unless it is purposely disabled via a browser setting or a plugin.  That brings up the obvious question...


=== What to do if a browser's JavaScript functionality is disabled? ===
===What to do if a browser's JavaScript functionality is disabled?===
The obvious answer is to enable JavaScript functionality.  OK, fine.  But, how does an end user know this needs to be done?  And more importantly, the image or images will all download, thus negating the NoScript Element / Tag.
The obvious answer is to enable JavaScript functionality.  OK, fine.  But, how does an end user know this needs to be done?  And more importantly, the image or images will all download, thus negating the NoScript Element / Tag.


A better answer would be to require JavaScript be enabled before allowing a user to view the website.  Some may consider this a bit Draconian, but if a website's presentation and display are dependent upon JavaScript the ability to view the site may not exist without it.  While it is certainly possible to develop a "no JavaScript" website, that would be a LOT of effort for that small percentage of 1% of circumstances that this would occur.  And it would then be a horrible experience compared to the "JavaScript enabled" site.  So in the end the only realistic solution is to require JavaScript to be enabled.
A better answer would be to require JavaScript be enabled before allowing a user to view the website.  Some may consider this a bit Draconian, but if a website's presentation and display are dependent upon JavaScript the ability to view the site may not exist without it.  While it is certainly possible to develop a "no JavaScript" website, that would be a LOT of effort for that small percentage of 1% of circumstances that this would occur.  And it would then be a horrible experience compared to the "JavaScript enabled" site.  So in the end the only realistic solution is to require JavaScript to be enabled.


=== Requiring JavaScript to be Enabled ===
===Requiring JavaScript to be Enabled===
For WordPress, the solution if fairly simple.  Add a Plugin.
For WordPress, the solution if fairly simple.  Add a Plugin.


'''WP JS Detect''' (Main Tab, Js Detect) is the only plugin I could locate.  It is a bit dated, but because its functionality is so simple, it will work with just about any version of WordPress.  There may of course be a day when it doesn't, but the code is there.  One other item to watch out for is that if it is ever Deactivated, any custom settings will be wiped out.  There is another plugin ('''WP No JavaScript or Cookie Checker'''), but it is even more dated and doesn't allow message customizing to be done as easily.
'''WP JS Detect''' (Main Tab, Js Detect) is the only plugin I could locate.  It is a bit dated, but because its functionality is so simple, it will work with just about any version of WordPress.  There may of course be a day when it doesn't, but the code is there.  One other item to watch out for is that if it is ever Deactivated, any custom settings will be wiped out.  There is another plugin ('''WP No JavaScript or Cookie Checker'''), but it is even more dated and doesn't allow message customizing to be done as easily.


=== Another Item to Consider ===
===Another Item to Consider===
Another item to consider is Internet Explorer.  On this little adventure I found that Internet Explorer 8 would actually work, but things looked really funky.  Oddly, a newer version of Internet Explorer (version 11), didn't work at all (even with JavaScript enabled).  So there needs to be additional detection.
Another item to consider is Internet Explorer.  On this little adventure I found that Internet Explorer 8 would actually work, but things looked really funky.  Oddly, a newer version of Internet Explorer (version 11), didn't work at all (even with JavaScript enabled).  So there needs to be additional detection.


Line 30: Line 30:


var $buoop = {required:{'.$browser.',i:12},test:'.(isset($wpbu_js[1]) ? $wpbu_js[1] : '').',newwindow:'.(isset($wpbu_js[2]) ? $wpbu_js[2] : '').',style:"'.(isset($wpbu_js[3]) ? $wpbu_js[3] : '').'",insecure:'.(isset($wpbu_js[4]) ? $wpbu_js[4] : '').',unsupported:'.(isset($wpbu_js[5]) ? $wpbu_js[5] : '').',mobile:'.(isset($wpbu_js[6]) ? $wpbu_js[6] : '').',shift_page_down:'.(isset($wpbu_js[7]) ? $wpbu_js[7] : '').',api:2020.01,text_for_i:"This website will NOT display or function properly with Internet Explorer.  Please use a modern web browser such as Firefox, Chrome, Edge, Safari, Opera, etc.",reminder:0,remind:0,no_permanent_hide:true,no_close:true,};
var $buoop = {required:{'.$browser.',i:12},test:'.(isset($wpbu_js[1]) ? $wpbu_js[1] : '').',newwindow:'.(isset($wpbu_js[2]) ? $wpbu_js[2] : '').',style:"'.(isset($wpbu_js[3]) ? $wpbu_js[3] : '').'",insecure:'.(isset($wpbu_js[4]) ? $wpbu_js[4] : '').',unsupported:'.(isset($wpbu_js[5]) ? $wpbu_js[5] : '').',mobile:'.(isset($wpbu_js[6]) ? $wpbu_js[6] : '').',shift_page_down:'.(isset($wpbu_js[7]) ? $wpbu_js[7] : '').',api:2020.01,text_for_i:"This website will NOT display or function properly with Internet Explorer.  Please use a modern web browser such as Firefox, Chrome, Edge, Safari, Opera, etc.",reminder:0,remind:0,no_permanent_hide:true,no_close:true,};
</syntaxhighlight>...to better control usage of Internet Explorer.  Full documentation can be found here: http://browser-update.org/customize.html
</syntaxhighlight>...to better control usage of Internet Explorer.  Full documentation can be found here: http://browser-update.org/customize.html Verified and tested that it actually works by clearing out the test browser's cache and looking at each individual file it downloaded.