JavaScript:无法加载资源:服务器响应状态为404(未找到)

时间:2017-09-01 12:18:12

标签: javascript jquery ajax

我使用的JavaScript应用在https://localhost:63342/WalletClient/index.html_ijt=k4ock08pqsve8hb7b2b34ou3h5的本地主机地址中打开。它看起来像这样,

enter image description here

当我点击余额按钮时,它应执行以下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,而不是尝试这样做。

这里有什么问题?

0 个答案:

没有答案