<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>location</title></head> <script type="text/javascript"> document.write( location.href+"<br/>"); var ahref=location.href; function test(){ window.open("ahref" ,"_blank","width=400px,height=400px") } </script></head><body><input type="button" value="点击弹出" onclick="test()"></body></html>为什么新打开的窗口不是location.href?
1 回答
李晓健
TA贡献1036条经验 获得超461个赞
window.open(ahref ,"_blank","width=400px,height=400px") // ahref 是变量不是字符串,不能加引号
添加回答
举报
0/150
提交
取消