[英]window.location.replace is not working on client side
I have a javascript function on my jsp page. 我在jsp页面上有一个javascript函数。
function gt()
{
var e=document.getElementById("ParentType");
var val=e.options[e.selectedIndex].value;
window.location.replace("iba1?value="+val);
}
I have created wizard for some functionality.The above code works fine in my machine,but if I test the same thing on client browser it is giving error like URL not available. 我已经为某些功能创建了向导。上面的代码在我的机器上可以正常工作,但是如果我在客户端浏览器上测试相同的东西,则会出现错误,例如URL不可用。
At the same time if I give whole location of jsp means it is working in client side but not in my machine.I've added path of jsp like this 同时,如果我给出了jsp的整个位置,则意味着它在客户端运行,而不是在我的机器上。我已经添加了jsp的路径
window.location.replace("netmarkets/jsp/actionitem/iba1.jsp?value="+val);
Why this happening?Some Ideas would be helpful 为什么会这样呢?有些想法会有所帮助
Did you try giving it the whole path? 您是否尝试过提供整个路径? The URL will not work probably because it is a relative path on the server side.
该URL可能不起作用,可能是因为它是服务器端的相对路径。
如果客户端部署和您的开发计算机具有不同的部署结构,则可能无法正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.