为了账号安全,请及时绑定邮箱和手机立即绑定

javascript问题

javascript问题

hawthornn 2016-01-05 16:42:04
<!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 是变量不是字符串,不能加引号


查看完整回答
反对 回复 2016-01-05
  • 1 回答
  • 0 关注
  • 1191 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号