detecting internet explorer 5

Results 1 to 2 of 2

Thread: detecting internet explorer 5

  1. #1
    Join Date
    Dec 1969

    Default detecting internet explorer 5

    Hi,<BR><BR>Is it possible to detect if a user is using internet explorer 5. I have some scripts that only work in IE 5, 5.5 and need to alert the user if they are using another browser.I have created the following function and just do<BR><BR>alert(browserName,browserVersion)<BR><BR >but I need to know how to extract the MSIE 5.5 from the browserVersion variable.<BR><BR>&#060;!-- Begin<BR>function whatBrowser() {<BR>var browserName=navigator.appName<BR>var browserVersion=navigator.appVersion<BR>alert(&#039 name of browser: &#039 + browserName + &#039
    version of browser: &#039 +browserVersion)<BR>}<BR>// End --&#062;<BR><BR><BR>hope you can help<BR><BR>

  2. #2
    Chad LaFarge Guest

    Default RE: detecting internet explorer 5

    Mark,<BR><BR>Here&#039s one solution, using regular expressions:<BR><BR>&#060;SCRIPT language="JavaScript"&#062;<BR>&#060;!--<BR> var expTestVersion = /[sw(;.]*MSIEs(d*.?d*)[sw);.]*/gi;<BR> var getBrowserVersion = navigator.appVersion;<BR> var reportBrowserVersion = getBrowserVersion.replace(expTestVersion, "$1");<BR> alert(reportBrowserVersion);<BR>--&#062;<BR>&#060;/SCRIPT&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts