[英]how to get redirected to the exact url in javascript
when I'm trying to go to url like this当我尝试像这样访问 url 时
$.get("getdetailofselectedcustmor/", function(){ $.get("getdetailofselectedcustmor/", function(){
}) })
in my js code , I'm redirected to 'current url + getdetailofselectedcustmor', but what I'm looking for is just to get redirected to 'localhost:8000/getdetailofselectedcustmor/', how can I do that?在我的 js 代码中,我被重定向到“当前 url + getdetailofselectedcustmor”,但我正在寻找的只是被重定向到“localhost:8000/getdetailofselectedcustmor/”,我该怎么做?
This is not a Django problem, it is a problem with the JS request这不是django的问题,是js请求的问题
make sure you always put /
before whatever resource path you want to request.确保始终将/
放在要请求的任何资源路径之前。
like this像这样
$.get("/getdetailofselectedcustmor/", function(...){...})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.