修丹道的人:能看懂JAVASCRIPT的高手请进~

来源:百度文库 编辑:高考问答 时间:2024/04/29 06:10:27
这段语句究竟在网页中起什么作用?<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>

这好像是网页制作软件自动加的吧。
大概意思:判断客户端浏览器类型,如果示netscape浏览器并且版本是4,那么就设定变量的值为浏览器宽高。否则,重新加载页面。