首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

javascript判断FireFox跟IE

2012-11-16 
javascript判断FireFox和IE如何判断是IE或者是FireFox呢? 我用最简单的例子说一下.?FF (navigator.userA

javascript判断FireFox和IE

如何判断是IE或者是FireFox呢? 我用最简单的例子说一下.

?

FF = (navigator.userAgent.indexOf("Firefox")!=-1);
IE = (navigator.userAgent.indexOf("MSIE")!=-1);

?

function test() {
? if(IE){
??? alert("is IE");

? }else{
??? alert("is not?IE");

? }
}

?

function test_1() {
? if(FF){
? ?alert("is FF");

? }else{
??? alert("is not?FF");

? }
}

调试一下就知道怎么用了.

?

热点排行