无法重定向到本地asp页面

时间:2013-09-11 11:17:07

标签: javascript jquery html

您好我正在尝试通过java脚本重定向到本地asp页面 window. location. replace()但似乎没有效果。

它使用window.location.replace("http://google.com"),但如果我放

则不行
window.location.replace("http://localhost..

任何想法?

感谢

2 个答案:

答案 0 :(得分:0)

试试这个,您可以使用href在其他页面或同一页面上重定向。

window.location.href="http://google.com"; 

或者

window.location.href="http://localhost.."

试试这个window.location = "http://www.google.com/"

答案 1 :(得分:0)

使用window.location.assign代替..

window.location.assign("http://localhost:57040/NewUserRegistration.aspx")

它对我有用..