我使用的JavaScript
应用在https://localhost:63342/WalletClient/index.html_ijt=k4ock08pqsve8hb7b2b34ou3h5
的本地主机地址中打开。它看起来像这样,
当我点击余额按钮时,它应执行以下Ajax GET
请求并尝试打开新页面balance.html
,
$("#balance").click(function () {
address = $('#address option:selected').text().trim();
selectedCurrency = $('#selectCurrency option:selected').text().trim();
// make sure in the backend the currency name samll/capital doesnt matter
$.ajax({
url: "https://www.hostdomain.com" + "/rest/wallet/addressAndCurrency" + "/" + selectedCurrency + "/" + address,
type: "GET",
dataType: "json",
success: function (data) {
var id = data["id"];
window.open("/WalletClient/balance.html?walletId=" + id);
},
failure: function (errMsg) {
console.log(errMsg.toString())
}
});
});
但是,在控制台中,我收到Failed to load resource: the server responded with a status of 404 (Not Found)
的消息,似乎它尝试从GET
:63342/WalletClient/https://www.hostdomain.com/rest/wallet/addressAndCurrency/Bitcoin/mnV3CR6435p1LKcbGa8GVwt9euWrf3wWEX
请求
我工作的Java应用程序未部署,因此,它无法提供任何响应。但是,我担心的是GET
请求应该尝试从JSON
的网址接收https://www.hostdomain.com/rest/wallet/addressAndCurrency/Bitcoin/mnV3CR6435p1LKcbGa8GVwt9euWrf3wWEX
,而不是尝试这样做。
这里有什么问题?