Questions tagged [xmlhttprequest]

XMLHttpRequest (XHR) is a JavaScript object that exposes an API for making asynchronous HTTP requests from frontend code running a Web browser — that is, for enabling the programming technique known as AJAX. The XHR API is a legacy API. It has been superseded by the Fetch API.

Example usage

function reqListener () {
      console.log(this.responseText);
}
    
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", reqListener);
oReq.open("GET", "http://www.example.org/example.txt");
oReq.send();

Taken from mozilla.org.

See also

11269 questions
3
votes
2 answers

VBA XML V6.0 How to make it wait for page to load?

I have been pulling my hair out trying to find an answer for this and I cant seem to find anything useful. Basically I am pulling from a website that loads more items on it while you are on the page. I would like my code to pull the final data after…
Forbidden
  • 55
  • 1
  • 8
3
votes
1 answer

XMLHttpRequest.upload.addEventListener("progress"... not working

I try to populate an upload bar by calling XMLHttpRequest.upload.addEventListener("progress", progressHandler, false);. Apparently my function progressHandler is not called at all. I do not have a clue, why. Everything else works fine, e.g. the…
Christian Graf
  • 386
  • 1
  • 9
  • 26
3
votes
1 answer

Javascript not pulling correct data from MySQL after using XMLHttp to update the DB

The newNet.php runs and correctly creates the new entry. The netID variable is an auto increment so it is created automatically. My goal is to then retrieve it and use it in the showActivities() function to display the record just created. For…
Keith D Kaiser
  • 790
  • 1
  • 8
  • 24
3
votes
2 answers

Test Credentials to access a web page

Is there a nice and tested piece of code out there that I can use for this purpose: get the user/pass and the address of a web service (asmx page) and check if the user/pass are valid or not. I think I should use HTTPRequest,etc to do that but I do…
Bohn
  • 24,195
  • 54
  • 155
  • 240
3
votes
2 answers

Any Node.js HTTP request module that works both in the server and in the browser when bundled with Webpack?

I need a request module that works both in the Node.js server and in the client, when bundled with Webpack. My requirements are really basic. I just need to do some HTTP Ajax requests, like get and post. Automatic JSON parsing would be awesome. I'm…
André Pena
  • 48,518
  • 37
  • 172
  • 216
3
votes
0 answers

Download file from Dropbox using javascript dropbox api

I tried to download a file from Dropbox using Core Api with javascript. Here is the method I have written. function downloadFile(path) { var url = "https://api-content.dropbox.com/1/files/auto/"+path; var result; var xhr = new…
Issac Johnson
  • 150
  • 3
  • 11
3
votes
3 answers

error Access-Control-Allow-Origin header on codeigniter

i am getting the error of XMLHttpRequest cannot load, No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://abc' is therefore not allowed access.. i am very new in php and codeigniter and so i cannot really…
xrurii
  • 31
  • 1
  • 1
  • 6
3
votes
3 answers

Trigger jQuery's ajaxStop event when aborted calls exist

I've used jQuery's ajaxSend and ajaxStop to show a spinner whenever ajax requests are active. It works except when some of my plugins abort their ajax requests, ajaxStop does not trigger and will not trigger until after the page is refreshed. It…
Jake
  • 11,124
  • 13
  • 57
  • 91
3
votes
2 answers

I'm doing it the hard way and _POST is empty

I've looked and looked but nothing quite touches this question. I'm trying to send an XMLHttpRequest via JavaScript* in Chrome. Here is my page: ROAM