javascript - ajax request works in firefox, does not work in chrome -


function ajx(url) {    var xhri = xhrrequest('xml');   var ajxout = '';   var out = '';    xhr[xhri].open('get', url, true);   xhr[xhri].setrequestheader('content-type', 'application/x-www-form-urlencoded; charset='+document.characterset);    xhr[xhri].onreadystatechange = function() {         console.log(xhr[xhri].readystate);      if (xhr[xhri].readystate == 4 && (xhr[xhri].status == 200 || xhr[xhri].status == 205)) {       dosomething();     }   } 

an ajax call function leads different result in chrome , firefox: in firefox, dosomething called, because onreadystatechange invoked several times , delivers readystate==4 in end. in chrome, however, onreadystatechange invoked once , logs readystate==0. how can be?


Comments

  1. The Star Entertainment Group to partner with casino and hotel
    The Star Entertainment Group is partnering with the 1xbet app Gold Coast Casino, Hotel, Entertainment and Skypod Resort, which will provide guests 전주 출장안마 with Feb 대전광역 출장안마 16, 2022The Star Gold 포항 출장샵 CoastDec 16, 2022The 충청북도 출장샵 Star Gold Coast

    ReplyDelete

Post a Comment

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -