简体   繁体   English

window.location.replace在客户端不起作用

[英]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.

相关问题 打开终端窗口客户端 - Open Terminal Window Client Side Java。 将文件保存到客户端不起作用 - Java. Save File to Client side not working Websockets无法从Windows 7客户端运行 - websockets not working client side from windows 7 服务器端等效于GWT中的Window.Location.getParameter() - Server side equivalent of Window.Location.getParameter() in GWT 需要客户端API来确定IP地址的地理位置 - Need a client side API for determing geo location of IP addresses 需要将数据存储在服务器上,而不是存储在客户端的浏览器窗口/选项卡上 - Need to store the data on the server instead on the browser window/tab on client side RMI:如何将服务器端和客户端类放置到网络可访问的位置? - RMI: How to place server-side & client-side classes to network-accessible location? 在Java7中而不是在Java8中工作的客户端证书认证代码 - client side certificate authentication code working in java7 and not in java8 使用SOAP Web服务的应用程序,注册功能在客户端不起作用 - Application using SOAP webservices, signup functionality not working on client side 已发送泽西岛2服务器+客户端事件源无法正常工作 - Jersey 2 Server Sent + client side Event source not working properly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM