Message from JavaScript discussions

February 2017

— Hii guys. I like to large video uploading . But iam not uploading videos . Can any help me out by using jquery

Thanks in advance

Message permanent page

— 

For large file upload via XHR is recomendable to use chunked file upload. Here is a JQuery plugin that supports that: https://github.com/blueimp/jQuery-File-Upload/wiki/Chunked-file-uploads

— +1

— Tiny baby ajax

function ajax (url = "/", resType = 'text') {
return new Promise (function (resolve, reject) {
var req = new XMLHttpRequest();
req.onreadystatechange = function () {
if (req.readyState === 4) {
if (req.status >= 400 && req.status < 600) {
reject("HTTP Error " + req.status + ": " + req.statusText);
} else if (req.status >= 200 && req.status < 400) {
resolve(req.response);
}
}
};
req.open("GET", url);
req.responseType = resType;
req.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
req.send();
});
}

Message permanent page

— 

ajax("/url", "json").then(function (response) {

  console.log(response.prop);

});

— +1. But this condition && req.status < 600, is really necesary?

— Just seem too paranoid, but I think it's ok 😂

— Heh

— Designers Hub - UI/UX
Community to share queries, post tips, latest trends and tricks relating to UI/UX design development. Articles from across groups into one repository... Lets Go Design how2design
https://t.me/how2design

Message permanent page

— Other Admins, DO NOT delete this! Yes it is spam (because no one requested and is almost not related to js) but Fazal is the admin of this group. So let's allow this post this time.

Message permanent page

— Right

— My apologies. I had sent request to few admins who were common admins for multiple groups. Seems this group is not owned by them. Thank you for allowing it for the timebeing.

Message permanent page