javascript - Ajax request in Chrome extension -
i developing extenion makes ajax request web server
var xhr = new xmlhttprequest(); xhr.open(method, url, true); xhr.setrequestheader("content-type","application/json"); xhr.send(json.stringify(data)); xhr.onreadystatechange = function() { if(xhr.readystate == 4 && xhr.status == 204) { //debugger; alert("logged in"); flag = 1; _callback(xhr, xhr.readystate); } }
and here able logged in status = 204 , once logged in trying go different directory example www.example.com/index/enter ajax request in same extension not able so.
are sure you're expecting same http response code? it's server you're making requests sending different response different request url.
204 no reponse = there no response data
200 ok = there data
Comments
Post a Comment