繁体   English   中英

端口8888 net :: ERR_CONNECTION_REFUSED

[英]port 8888 net::ERR_CONNECTION_REFUSED

我在尝试调用Web服务侦听端口8888时遇到以下问题:

GET http://localhost:8888/rauco/oxygen/1/1/last net::ERR_CONNECTION_REFUSED functions.misc.js:43
Uncaught SyntaxError: Unexpected end of input functions.misc.js:46

function.misc.js:

function get_last_oxygen(location, start_time, end_time)
{
    var xmlHttp = null;
    var oxy_url = 'http://localhost:8888/' + location + '/oxygen/1/1/last';
    xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", oxy_url, true );
    xmlHttp.send( null );// line 43
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
            var json = JSON.parse(xmlHttp.responseText);//line 46
            var oxy = document.getElementById('oxygen');
            oxy.innerHTML = json.oxygen;
            get_oxygen_range(location, start_time, end_time);
            //alert(xmlHttp.status + ' ' + xmlHttp.responseText);
       }
    }
}

如果它在浏览器中有效,则尝试将url从localhost更改为127.0.0.1。 如果有效,则表示您的环境未将localhost解析为127.0.0.1

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM