Questions tagged [xmlhttprequest-level2]

XMLHttpRequest Level 2 defines various new methods over XMLHttRequest level 1, such as the FormData object and new response types.

XMLHttpRequest level 2 adds new functionality over level 1, including:

See also

68 questions
2
votes
0 answers

Why is XMLHttpRequest so slow on localhost

We're developing an application that uses XMLHttpRequest for uploading files with drag&drop support. We're using a jQuery plugin for that, but it's not the issue here. Our tester has reported that uploading files on localhost takes a serious amount…
d4rky
  • 469
  • 6
  • 13
2
votes
1 answer

What's the optimal length for HTTP range request

I have a javascript downloader that gets big files by multiple HTTP range requests: xhr.setRequestHeader("Range", "bytes=" + start + "-" + end); while end is var end = start + length The range request is a must, because I need to get specific…
whadar
  • 4,181
  • 4
  • 19
  • 21
1
vote
0 answers

pause and resume XMLHttpRequest

Here is a working code to preload an MP4 video file on the browser via XHR2. Whenever we execute preloadMe(); the video starts to preload and composite progress event. and as the file completely loaded preload.oncomplete fires and we can detect…
Sara Ree
  • 3,417
  • 12
  • 48
1
vote
1 answer

Why is XMLHttpRequest upload not failing properly in Firefox?

I'm implementing a file uploader where a user can upload one or more files, using XMLHttpRequest. I'm not using fetch as I need to be able to provide visual feedback on upload progress to the user. The problem I'm having occurs when the server stops…
1
vote
1 answer

PHP handle $_POST from XMLHttpRequest2 with new FormData() and append()

Using PHP how can I process data sent via XMLHttpRequest2 with new FormData() and append() like traditional form data? In my AJAX parameters handling function the parameters would look like the following: q1=v1&q2=v2&q3=v3 You could use…
John
  • 1
  • 13
  • 98
  • 177
1
vote
0 answers

Why is progress bar animation not updating by the XmlHttpRequest's addEventListener("progress" ..)?

Here's the working example of Javascript/JQuery multiple file upload using the XmlHttpRequest API. Then I noticed the progress bar animation is not updating itself. Upon debugging I found that the XmlHttpRequest's Progress listener is working. …
1
vote
1 answer

How to disable google chrome cross domain security

What's the command to disable the cross domain security in Google Chrome on Ubuntu.
elhoucine
  • 2,356
  • 4
  • 21
  • 37
1
vote
0 answers

Is there a workaround for CORS when using XMLHttpRequest with a local file?

I'd like to use Exif.js to read JPEG EXIF tags from a local file. However, the javascript lib uses XMLHttpRequest to read JPG files as a BinaryFile: function getImageData(oImg, fncCallback) { BinaryAjax( oImg.src, …
michael
  • 4,377
  • 8
  • 47
  • 73
1
vote
1 answer

How to I refer to the `postMessage()` function from my XHR callbacks?

The file uploads work perfectly, I can't get the progess and load events to callback I have the following in a JavaScript file as my WebWorker code: UploadFileWorker.js function uploadFile(url, m) { var f = m.file; var fd = new FormData(); …
user177800
1
vote
2 answers

How to know which is submited when several ones are defined within a
?

I want to implement the below simple JavaScript function submitForm() based on XMLHttpRequest and FormData. This functions works well on the first but fails on the second one: the function should use input.formaction instead of form.action.…
oHo
  • 51,447
  • 27
  • 165
  • 200
1
vote
1 answer

Cant create FormData object

I tried to create the form data But i can't if(window.FormData) { alert("okk"); } else { alert("not okk"); } It alerts not okk What i do now? I have checked the official mdn documentation of the object but found nothing
bhawin
  • 267
  • 1
  • 6
  • 15
1
vote
1 answer

How to get the pixel data of an PNG downloaded using XMLHttpRequest (XHR2)

I am using this code from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data var oReq = new XMLHttpRequest(); oReq.open("GET", "/myfile.png", true); oReq.responseType = "arraybuffer"; oReq.onload =…
James Cat
  • 432
  • 2
  • 12
1
vote
0 answers

cannot upload files and vars with xhr2 and web workers

I try to create code to upload files using XHR2 and web workers. I thought I should use web workers , so if a file is big, web page will not freeze. This is not working for two reasons, I never used web workers before, and I want to post to the…
slevin
  • 4,166
  • 20
  • 69
  • 129
1
vote
2 answers

Javascript For Loop To Slow for Progress Event Listener Fireing

I am trying to change a element background color according the the progress of an upload. The problem I am having is the for loop is way to slow compared to the progress event listener that fires off. Is there anything I can do about this? var…
dman
  • 10,406
  • 18
  • 102
  • 201
1
vote
2 answers

XmlHttpRequest level 2 : Response returns nothing

I have this problem, I've already asked this question yesterday but i did not have any answer... :( I have this code on the client-side: var formdata = new FormData(); //fill fields of formdata... for example: var file =…
Martina
  • 1,852
  • 8
  • 41
  • 78