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

为什么跳转没反应,重新打开一个窗口就行

window.location="http://www.imooc.com/";
window.location.assign("http://www.w3school.com.cn");
window.location.href="http://www.imook.com";
window.open("http://www.imooc.com/","_blank","width=500px,height=500px");
 只有最后一行重新打开页面才有反应,其他的都没效果


正在回答

2 回答

哇 学到了


0 回复 有任何疑惑可以回复我~

得引入JavaScript引用语句:<script type="text/javascript" language="javascript">

另外也得有HTML标签才行,具体如下:

<html>

<head>

<script type="text/javascript">

window.location="http://www.imooc.com/";

        window.location.assign("http://www.w3school.com.cn");

        window.location.href="http://www.imook.com";

        window.open("http://www.imooc.com/","_blank","width=500px,height=500px");

</script>

</head>

</html>

还有注意你第二行结尾用了中文分号


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为什么跳转没反应,重新打开一个窗口就行

我要回答 关注问题
微信客服

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

帮助反馈 APP下载

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

公众号

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