if (window.XMLHttpRequest) {
// IE 7, mozilla, safari, opera 9
} else {
// IE6, older browsers
}
Archive for June, 2009
Detect IE7 in JS
Tuesday, June 30th, 2009Using JavaScript to read CSS from external file
Tuesday, June 30th, 2009function get_style( obj, cssprop ){
if (obj.currentStyle){ // IE
return obj.currentStyle[cssprop];
}else if (document.defaultView && document.defaultView.getComputedStyle){ // DOM
return document.defaultView.getComputedStyle(obj, “”)[cssprop];
}else{ // get inline style
return obj.style[cssprop];
}
}