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

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -