<HTML> <Head> <script languaga="JavaScript"> Var test=window.prompt("请输入数据:"); document.write(test+"JavaScript输入输出的例子"); </script> </Head> </HTML> |
参 数 | 设定值 | 含 义 |
toolbar | yes/no | 建立或不建立标准工具条 |
location | yes/no | 建立或不建立位置输入字段 |
directions | yes/no | 建立或不建立标准目录按钮 |
status | yes/no | 建立或不建立状态条 |
menubar | yes/no | 建立或不建立菜单条 |
scrollbar | yes/no | 建立或不建立滚动条 |
revisable | yes/no | 能否改变窗口大小 |
width | yes/no | 确定窗口的宽度 |
Height | yes/no | 确定窗口的高度。 |
<HTML> <HEAD> <TITLE></TITLE> </HEAD> <BODY> <Script Language ="JavaScript"> alert("这是一个JavaScript测试程序"); </Script> </BODY> </HTML> |
<HTML> <HEAD> <TITLE></TITLE> </HEAD> <BODY> <Script Language="JavaScript"> <!-- Hide From Other Browsers document.write("<H1>有关交互的例子"); my=prompt("请输入数据:"); document.write(my+"</H1>"); document.close(); // Stop Hiding from Other Browsers--> </Script> </BODY> </HTML> |
<html> <form name="myform"> <td vAlign="top" width="135">您在此停留了: <input name="clock" size="8" value="在线时间"></td> </form> <script language="JavaScript"> var id, iM = 0, iS = 1; start = new Date(); function go() { now = new Date(); time = (now.getTime() - start.getTime()) / 1000; time = Math.floor( time); iS = time % 60; iM = Math.floor( time / 60); if ( iS < 10) document.myform.clock.value = " " + iM + " 分 0" + iS + " 秒"; else document.myform.clock.value = " " + iM + " 分 " + iS + " 秒"; id = setTimeout( "go()", 1000); } go(); </script> </body> </html> |
联系客服