WSD
VaR browser = {
Isie :(! Navigator. useragent. Match (/Gecko /)&&! Window. Opera ),
Isie7: (navigator. useragent. Match (/MSIE \ s + 7/I )),
Isie8: (navigator. useragent. Match (/MSIE \ s + 8/I )),
Isie6 :(! Navigator. useragent. Match (/Gecko /)&&! Window. Opera )&&(! Navigator. useragent. Match (/MSIE \ s + 7/I ))&&(! Navigator. useragent. Match (/MSIE \ s + 8/I )),
Issafari: (navigator. useragent. Match (/Safari/I )),
Ischrome: (navigator. useragent. tolowercase (). indexof ("Chrome")>-1 ),
Ismac: (navigator. Platform. Match (/MAC/I )),
Isopera :!! Window. opera,
Iswindows: navigator. Platform. Match (/win [0-9] +/I)
};
Lhgcore. j browser Detection
(Function (){
VaR axt = !! Window. activexobject,
B = {
IE: axt,
I7: axt &&!! Window. XMLHttpRequest,
I8: axt &&!! Document. queryselectorall,
OP :!! Window. opera,
FF :!! Window. components,
Sa :!! Window. opendatabase
};
Lhgcore. browser = B;
})();
/*
VaR is_ie = (navigator. appname = "Microsoft Internet Explorer ");
VaR is_nn = (navigator. appname = "Netscape ");
If (is_ie ){
Alert ("this is ie! ");
} Else {
Alert ("this is no ie! ");
}
*/
If ( ! /* @ Cc_on! @ */ 0 ){
Alert ( ' No IE ' );
} Else {
Alert ( ' IE ' );
}
If ( ! + " \ V1 " ){
Alert ( ' IE ' );
} Else {
Alert ( ' No IE ' );
}
VaR isie = (document. All )? True: false;
If (isie) {alert ("is ie")} else {alert ("No ie ");}