繁体   English   中英

如何在javascript中重定向到确切的网址

[英]how to get redirected to the exact url in javascript

当我尝试像这样访问 url 时

$.get("getdetailofselectedcustmor/", function(){

})

在我的 js 代码中,我被重定向到“当前 url + getdetailofselectedcustmor”,但我正在寻找的只是被重定向到“localhost:8000/getdetailofselectedcustmor/”,我该怎么做?

这不是django的问题,是js请求的问题

确保始终将/放在要请求的任何资源路径之前。

像这样

$.get("/getdetailofselectedcustmor/", function(...){...})

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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