【发布时间】:2016-11-07 18:03:44
【问题描述】:
更新代码
<div>
<button type="button" class="submit btn btn-default" id="btnSubmit">Submit
</button>
<button type="button">Cancel</button>
</div>
<script>
$("#btnSubmit").click(function(e)
{
e.preventDefault();
//btn Click validation and code submission goes here..
alert("Form has been successfully submitted");
window.open("http://....../viewmyrequest.aspx","_self");
}
</script>
window.location.href 仅在调试模式下工作,如果我关闭调试模式,则不会重定向到其他窗口。
我已经探索了许多具有相同主题的 StackOverflow 问题,但我没有得到任何可靠的答复。
window.location.href = "http://testwebsite.com/viewtickets.aspx"
我也尝试过其他选择
window.location = "http://testwebsite.com/viewtickets.aspx"
window.location.replace = "http://testwebsite.com/viewtickets.aspx"
【问题讨论】:
-
什么不起作用?
-
window.location 重定向不起作用
-
好的,那么是什么触发了代码运行?
-
按钮点击 iframe。
-
按钮 html 是什么样的?
标签: javascript jquery angularjs ajax html