Javascript Browser ID and Ajax

I enherited some code and it works on FF, IE, Safari but not Chrome.  It seems that the javascript is looking for something different than Chrome is IDing.

The lines of code in questions are:
var iex=(document.all);
var nav=(document.layers);
var old=(navigator.appName=="Netscape" && !document.layers && !document.getElementById);
var n_6=(window.sidebar);

This is how we ID the browser, this works fine for all but Chrome.

Anyone have any idea on what would ID Chrome correctly?

You can see the full file here: http://www.austinkayak.com/utilities/javascript/MouseOverAttrPopUp.js

As for what this is doing, you can see the results but visiting this page and putting your mouse over any of the kayaks, it is making an AJAX call to retrieve the information.  In Chrome it will not display the DIV even though it is firing off the AJAX.

http://www.austinkayak.com/catalog_products.php?SubcatID=310002

Any help would be greatly appreciated.
LVL 9
pmessanaAsked:
Who is Participating?
 
hieloCommented:
>>Anyone have any idea on what would ID Chrome correctly?

try chaning:
var n_6=(window.sidebar);

to:
var n_6=(window.sidebar || (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) );
0
 
pmessanaAuthor Commented:
Perfect!  

I knew it was something simple.

Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.