Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var upload = function(files) {
- var formData = new FormData(),
- xhr = new XMLHttpRequest(),
- x = 0;
- for(x = 0; x < files.length; x++) {
- formData.append('file[]', files[x]);
- }
- console.log(x);
- xhr.onload = function() {
- var data = JSON.parse(this.responseText);
- displayUploads(data);
- };
- xhr.open('post', 'upload.php');
- xhr.send(formData);
- };
- Uncaught SyntaxError: Unexpected token < in JSON at position 0
- at JSON.parse (<anonymous>)
- at XMLHttpRequest.xhr.onload (строка 55, там где x = 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement