Simple web server - 668 Part III . Document Objects Reference The
668 Part III . Document Objects Reference The appName property returns the official name for the browser application. For Netscape browsers, the appNamevalue is Netscape; for Internet Explorer, the value is Microsoft Internet Explorer. The appVersionand userAgentproperties provide more meaningful detail. I start with the appVersion property because it is revealing and, at times, misleading. Using the appVersion property A typical appVersionproperty value looks like the following (one from NN6, one from IE5): 5.0 (Windows; en-US) 4.0 (compatible; MSIE 5.5; Windows 98; compat; DigExt) Because most version decisions are based on numeric comparisons (for exam ple, the version is equal to or greater than 4), you frequently need to extract just the number part of the string returned by the appVersionproperty. The cleanest way to do this is via the parseInt() or parseFloat()methods. Use parseInt(navigator.appVersion) if you are interested only in the number to the left of the decimal; to get the complete leading floating-point number, use parseFloat(navigator.appVersion) All other characters after the leading numbers are ignored. Also notice that the number does not always accurately represent the version of the browser at hand. For instance, IE5.5 reports that it is version 4.0. The number is more indicative of a broad generation number rather than a specific browser ver sion number. In other words, the browser exhibits characteristics of the first browsers to wear the appVersionof 4 (IE 4.0, it turns out). While this means that IE5.5 can use everything that is in the language and object model of IE4, this obvi ously doesn t help your script to know if the browser is capable of IE5.5 scripting features. At the same time, however, buried elsewhere in the appVersion string is the wording MSIE 5.5 the true version of the browser. IE uses this technique to distinguish the actual version number from the generational number. Therefore, for IE, you may have to dig deeper by using string methods such as indexOf()to see if the appVersioncontains the desired string. For example, to see if the browser is a variant of IE5, you can test for just MSIE 5 as follows: var isIE5x = navigator.appVersion.indexOf( MSIE 5 ) != -1 Or to know if the browser is IE5.5, include more of the string: var isIE5_5 = navigator.appVersion.indexOf( MSIE 5.5 ) != -1 There is a hazard in doing this kind of testing, however. Going forward, your code will break if future versions of IE have larger version numbers. Therefore, if you want to use IE5 features with an IE6 browser (assuming such a browser becomes available), your testing for the presence of MSIE 5 fails and the script thinks that it cannot use IE5 features even though they most certainly would be navigator.appVersion
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.