[thelist] Age. Was: HTML test (tip): The other side.

Jay Turley jay at weberrific.org
Thu Aug 24 14:22:16 CDT 2000


Heh. Is my face red?

<tip type="javascript" subject="cross-browser compatibility">
Recent use of split() has given me some interesting results. The most 
recent is the fact that IE and Netscape have different null characters.
In the following code, I had to set the nullcharacter so that both browsers 
would work properly on the if() statement.

var agt=navigator.userAgent.toLowerCase(); 
var is_ie = (agt.indexOf("msie") != -1); 

priceStringParts = priceString.split(".");
// cross-browser fix ***
var nullchar = (is_ie)?null:undefined;
// ***
if (priceStringParts[1] == nullchar) {
}

Only then would the if() statement process properly.
</tip>

- Jay Turley ---------------------------------------------------------
  http://www.weberrific.org
 "Any sufficiently advanced magic is indistinguishable from technology"





More information about the thelist mailing list