当前位置: 代码迷 >> JavaScript >> 初学js,第一个例子就碰壁了,该如何解决
  详细解决方案

初学js,第一个例子就碰壁了,该如何解决

热度:264   发布时间:2012-04-01 17:23:46.0
初学js,第一个例子就碰壁了
<html>
<head>
<script LANGUAGE="JavaScript">
<!--
function openwin() {
window.open ("page.html", "newwindow", "height=100, width=400, toolbar

=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no"

}
-->
</script>
</head>
<body onload="openwin()">
...任意的页面内容...
</body>
</html>

我只是想蹦出个页面 死活不显示 检查很多遍了 求指导

------解决方案--------------------
HTML code

<head>
<title>弹出窗体</title>
    <script type="text/javascript" language="JavaScript">
        window.open("10-1.html", "newwindow", "height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
    </script>

</head>
<body onload="openwin()">
    ...任意的页面内容...
</body>

------解决方案--------------------
1楼正解
<!--
function openwin() {
window.open ("page.html", "newwindow", "height=100, width=400, toolbar

=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no"

}
-->
注释了?<!-- -->
------解决方案--------------------
探讨

HTML code

<head>
<title>弹出窗体</title>
<script type="text/javascript" language="JavaScript">
window.open("10-1.html", "newwindow", "height=100, width=400, toolbar=no, menubar=no, scrollba……

------解决方案--------------------
目测window.open函数结束时少一个),并且里面的逗号似乎是中文的,得换成英文的
  相关解决方案