簡體   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