用IE打开会在页面提示:"你现在使用的.........推荐使用....Firefox"
有的发一下.谢谢!
|
|
#5 (页面定位) |
|
注册日期: 2006-08-07
住址: 化州-湛江-东莞
帖子: 2651
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
http://bbs.chinahtml.com/67192
![]() var daysToSleep = 2; var hasIE_phone_home = 0; //added functions to use cookies to show users the notice every daysToSleep function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } // This function does the actual browser detection function hasIE_hasIE() { var ua = navigator.userAgent.toLowerCase(); return ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (location.href.indexOf('seenIEPage') == -1)); } function hasIE_showLayer(whichLayer) { if (document.getElementById) { var style2 = document.getElementById(whichLayer).style; style2.display = "block"; } else if (document.all) { var style2 = document.all[whichLayer].style; style2.display = "block"; } else if (document.layers) { var style2 = document.layers[whichLayer].style; style2.display = "block"; } } // Hides and shows sections of the page based on whether or not it's // running in IE function hasIE_hideAndShow() { if (hasIE_hasIE()) { if (readCookie('xaviersCookie') == null){ hasIE_showLayer("hasIE_level1"); createCookie('xaviersCookie','seenIEBanner',daysToSleep); } } } function closediv(i) { document.getElementById(i).style.display='none'; } addEvent(window,'load',hasIE_hideAndShow); |
|
|
|