I work on a JavaScript
app that opens in the localhost address of https://localhost:63342/WalletClient/index.html_ijt=k4ock08pqsve8hb7b2b34ou3h5
. It looks like this,
When I click the balance button, it should execute the following Ajax GET
request and tries to open a new page 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())
}
});
});
However, in the console, I get the message of Failed to load resource: the server responded with a status of 404 (Not Found)
and it seems that it tries to receive the GET
request from the URL of :63342/WalletClient/https://www.hostdomain.com/rest/wallet/addressAndCurrency/Bitcoin/mnV3CR6435p1LKcbGa8GVwt9euWrf3wWEX
The Java app I worked is not deployed and hence, it won't be able to provide any responses. However, my concern is the GET
request should try to receive the JSON
from the URL of https://www.hostdomain.com/rest/wallet/addressAndCurrency/Bitcoin/mnV3CR6435p1LKcbGa8GVwt9euWrf3wWEX
which is not trying to do.
What is the issue here?