帮我看看javascript的location对像,写得哪里不对
Href 设置或返回当前浏览器所载入文档的完整Url Host 设置或返回url的宿主和端口。 Hostname 设置或返回url的宿主,包括主机名或ip地址。 Port 设置或返回url的端口。 Portocal 设置或返回url的协议。 Pathname 设置或返回url的路径 Search 设置或返回url的可是那字符串“?”后边的部分 Hash 设置或返回url的无用部分。 这是教程上的定义 可是我执行如下教程中的代码,怎么 和教程上的结果不一样呢? 尤其是点击提交按钮后,更是打不开网页了? 我放到我的网站上的代码及网址如下: <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>JavaScript练习</title> <script language="javascript"> //location对像 document.write(" ef="+location.herf+"<br>") document.write("location.host="+location.host+"<br>") document.write("location.hostname="+location.hostname+"<br>") document.write("location.port="+location.port+"<br>") document.write("location.portocal="+location.portocal+"<br>") document.write(" thname="+ thname+"<br>") document.write(" arch="+ arch+"<br>") document.write("location.hash="+location.hash+"<br>") </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <input type="submit" name="Submit" value="提交" onclick="window.location.herf=' ml';" /> <input type="submit" name="Submit2" value="提交" onclick=" arch='haodd+123';"/> </form> </body>
JavaScript练习 //location对像 document。write(" ef="+location。herf+"
") document。write("location。host="+location。
host+"
") document。write("location。hostname="+location。hostname+"
") document。write("location。port="+location。
port+"
") document。write("location。portocal="+location。portocal+"
") document。write(" thname="+ thname+"
") document。
write(" arch="+ arch+"
") document。write("location。hash="+location。hash+"
") 2个小错误: input的type要为button而不是submit href拼写错误(herf)。
答: function calcu() { var number1=document.form1.number1.value; var number2=docu...详情>>
答:的意思是找不到指定的文件,你确定你的文件路径正确吗? 另外,调用的部分你用 n(shcmd)试试详情>>