简体   繁体   中英

window.location.replace is not working on client side

I have a javascript function on my jsp page.

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.

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

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.

如果客户端部署和您的开发计算机具有不同的部署结构,则可能无法正常工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM