Axure / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

broken browser sniffing code #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
- What steps will reproduce the problem?
do not use conditional javascript include.

- What is the expected output? 
the browser sniffing code should work and do nothing in gecko based
browsers, for instance.

- What do you see instead?
error message with firefox 3.0.7: 
> navigator.appVersion.match(/MSIE (\d\.\d)/) is null

- What version of the product are you using? 
2.0 beta 3

- On what operating system?
Windows Vista Sp1 (6001)

HTH

Original issue reported on code.google.com by mmoos...@gmail.com on 19 Mar 2009 at 10:10

GoogleCodeExporter commented 9 years ago
i fixed it replacing line:
<pre><code>
var appVersion = IE7.appVersion = navigator.appVersion.match(/MSIE 
(\d\.\d)/)[1];
</code></pre>

by:
<pre><code>
var nAV = navigator.appVersion.match(/MSIE (\d\.\d)/);
if ((nAV != null) && (nAV.length > 1)) {
  nAV = nAV[1];
} else {
  nAV = 1;
}
var appVersion = IE7.appVersion = nAV;
</code></pre>

Original comment by mmoos...@gmail.com on 19 Mar 2009 at 10:19

GoogleCodeExporter commented 9 years ago
Please use conditional comments to use IE7.js. I'm not going to put that logic 
into the 
JavaScript.

Original comment by dean.edw...@gmail.com on 11 Feb 2010 at 2:11