Testing browser type and version using Javascript#################################################################################################### Browser test - Javascript. - this snippet tests for a type and version of a browser #################################################################################################### To test the browser used to view a web page the following Javascript example may be used to deterimine and either display a pop up windows or redirect the user to a different page. This example will redirect a viewer to a page explaining that they are using the "wrong" browser, in this example the application required Micrsoft Internet Explorer version 6.0. This script let the user know they weren't using the right tool. (which means the users were smarter than the coders...) #################################################################################################### <html> <head> <SCRIPT LANGUAGE="JavaScript" type="text/javascript"> if (!navigator.userAgent.match(/MSIE 6\.0/)) { document.write ("Not IE 6.0, redirecting"); window.location = "http://some-bogus-server.moc/really/wrong-browser-for-this-poorly-written-app.html" ; } else { document.write ("IE 6.0"); } </SCRIPT> </head> <body> This paragraph will only be displayed for IE 6.0 users, and everyone else will be redirected the the "scolding" page explaining that they are complete ninnies for using something other than what the clueless creator(s) of this website expected. if you are in Internet Explorer 6.0 and reading this, SUCCESS... If you are not using IE 6.0: then this snippet of javascript is a failure... </body> </html> #################################################################################################### Yes, there really are applications written that require Internet Explorer, and even specific versions. Yes, there are people that write web applications specific for one version of a browser, and usually it's for Microsoft Internet Explorer. This is a prime example of very poorly written application in that it does not comply with basic internet standards. If you run across an application that requires Internet Explorer, and worse, a specific version of it... well, I'd run the other direction. The security risks of using IE like this are mind-numbing. The developer(s) clearly used a proprietary function that only existed in Microsoft's version. This increases security risks and limits end-user availability. These developers need to learn how to reproduce such functionality using existing tools and standards and avoid the "hook' offered by Microsoft to make coding easier, unless of course those tools permit the use by all browsers meeting a specfic standard to work. Generally this isn't the case. Microsoft has been penalized before for corrupting existing standards with the apparent intent of locking in users to their product. They were fined $35M for breaking the license agreement of Java by adding proprietary "hooks", resulting in their formation of Microsoft's C#, a hamstrung versin of Java and part of the .NET suite of tools that was until about 2013 very restrictive and limited to Microsoft systems. The MONO project built tools to work with .NET and eventually Microsoft provided the necessary tools for interoperabilty. There are leaders in charge that will actually pay for applications that allow a business to be hooked into a proprietary tool. Clearly they have not had adequate training in standards or computer science. The internet was built on open standards, to place proprietary restrictions on any part of it limits activity and creates security risks. It also requires extensive rework and migration later when versions are updated or a vendor using proprietary code quits. Designers must consider interoperabilty, portability of data and controls, and conforming to existing, yet transitory, standards in order to protect the data and their users, and to keep software costs to a minimum. Tools must be able to support legacy code and not deprecate functionality, as this requires expensive recoding. #################################################################################################### |
-- Linux commands, scripts, tools and systems administration -- |
SEARCH and Navigation TOOL |
|
Everett weather -- Seattle - Everett traffic -- assorted News parallel NASB/KJV -- BBC: Middle East South East Asian Missions -- Voice of the Martyrs ![]() Nuts-Bolts-Wrench specs john's vehicle history since 1972 |
|