javascript Window.Navigate 方法在 Firefox 和 Chrome 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13429382/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 18:44:54  来源:igfitidea点击:

Window.Navigate Method Not Working in Firefox and Chrome

javascriptasp.net

提问by Deepak S V

Possible Duplicate:
button javasript works on IE but not firefox window.navigate()

可能重复:
按钮 javasript 适用于 IE,但不适用于 firefox window.navigate()

I want pass Question ID to Answer Page Along with URL but it's not working on Chrome and Firefox I'm using ASP.Net,

我想将问题 ID 与 URL 一起传递给答案页面,但它不适用于 Chrome 和 Firefox 我使用的是 ASP.Net,



Navigate Method is not working , what are other methods for this ?

导航方法不起作用,还有什么其他方法可以解决这个问题?



function display(QuestionID)

{

 window.navigate("Answer.aspx?TutID=" + QuestionID);

}

please Help

请帮忙

回答by Amin Sayed

Try this:

试试这个:

var url = "Answer.aspx?TutID=" + QuestionID;

location.href = url;