简体   繁体   English

谷歌Chrome - 使用ajax时停滞不前,如何解决?

[英]Google Chrome - stalled when using ajax, how to fix it?

In my home/office it worked fine. 在我的家/办公室,它工作得很好。

在此输入图像描述

But yesterday i went to setup this to a customer location where they have dedicated internet. 但是昨天我把它设置到了一个客户所在地,他们有专门的互联网。 But in there network all my packets are getting lost of delayed and completely the whole thing not working as it was working in my home/office network to the cloud. 但是在网络中,我的所有数据包都会因为延迟而丢失,完全不能正常工作,因为它在我的家庭/办公室网络中工作到云端。

I get often Google Chrome > network > Timing > Connection setup = Stalled 14.89s and red line of the URL 我经常使用谷歌浏览器>网络>时间>连接设置=停止14.89s和URL的红线

在此输入图像描述

How can i fix it please? 我该怎么办呢? I spend several hours with there networking guys but they think its my code causing it? 我花了几个小时与网络人员,但他们认为我的代码导致它? i am very confused now. 我现在很困惑。

var maincrawl_timer = null;

function crawl() {
    maincrawl_timer = setTimeout(function() {
        var s1 = $.get(submit_url + '/inbox', {
            action: 'spinbox',
            ousername: main_username,
            status: 'offline'
        }, function(msg) {
            for (drawSixRowOnly in msg.db) {}
        }, 'json');

        s1.always(function() {
            console.log('>>> crawl started. Are you sure its not causing Stalled??????????????????');
            crawl();
        });

    }, 3000);
}

// Boot once
crawl();

// Button used - to receive request
function ackowledge(input1, input2) {
    var chk = input2 + '_' + input1;
    if (search_row(chk) == chk) {
        error_show('Accepted by someone else.');
        return false;
    }

    $('#form1_show').show();
    $('#form1_title').html(input2);
    $.post(submit_url + '/spack', {
        action: 'spack',
        ousername: main_username,
        id: input1,
        kiosk: input2
    }, function(msg) {
        if (msg.result == 'ok') {
            spformid = msg.spformid; // selected: ACknowledge id 
            $('#form1_body').html(msg.form);
        } else {
            $('#form1_body').html('Failed');
        }
    }, 'json');
}

I don't see anything in your code that would be causing stalled HTTP traffic. 我没有在您的代码中看到任何会导致HTTP流量停滞的内容。 What do the HTTP request/response headers look like in your Chrome dev tools when you try to access the server? 当您尝试访问服务器时,Chrome开发工具中的HTTP请求/响应标头是什么样的? Are you getting 403 errors? 你有403错误吗? Try SSHing into the server from your client or ask the network engineers to curl on the server with your client URL. 尝试从客户端SSH服务器或要求网络工程师使用您的客户端URL卷曲服务器。 If all this appears to show that the server will accept packets from the client, then perhaps you are sending your packets to the incorrect port or you are not authenticated properly. 如果所有这些都表明服务器将接受来自客户端的数据包,那么您可能正在将数据包发送到错误的端口,或者您未经过正确的身份验证。 In the case that you are not authenticating properly, learn about the server's security requirements. 如果您未正确进行身份验证,请了解服务器的安全要求。 You may have to implement Oauth/cookies/Access-Control-Allow-Origin headers to authenticate properly. 您可能必须实现Oauth / cookies / Access-Control-Allow-Origin标头才能正确进行身份验证。

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

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