哪为大虾把我看下下面的jsp是做什么用的啊 急急急

来源:百度知道 编辑:UC知道 时间:2024/05/29 02:41:53
var bo_noscript_id = 0;

function isIE() {
var strBrowser = navigator.userAgent.toLowerCase();
return (strBrowser.indexOf("msie") > -1 && strBrowser.indexOf("mac") < 0);
}

function startIeFix() {
if (isIE()) {
document.write('<div style="display: none;" id="bo_noscript_id_' + bo_noscript_id + '">');
}
}

function endIeFix() {
if (isIE()) {
document.write('</div>');
var theObject = document.getElementById("bo_noscript_id_" + bo_noscript_id++);
theObject.outerHTML = theObject.innerHTML;
}
}

这是javascript脚本
isIE()的作用是:
先获取用户浏览器的信息字符串,然后检查其中是否包含msie来判断是否是ie浏览器,但后面有个条件,就是不得包含mac(苹果电脑,因为苹果电脑上也有ie浏览器).
startIeFix()的作用是:
如果浏览器是ie,就创建一个div的开始标签,并将其隐藏
endIeFix()的作用是:
如果浏览器是ie,先创建div的结束标签,然后把theObject的全部(包括标签自身和内容)替换成theObject内部的html代码。