Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#someid").on("submit", function (e) {
- var formData = new FormData(this);
- $(".progress").show();
- $.ajax({
- type: "POST",
- url: "somefile.php",
- xhr: function () {
- //var myXhr = $.ajaxSettings.xhr();
- //if (myXhr.upload) {
- // myXhr.upload.addEventlistener("progress", progress, false);
- //}
- //return myXhr;
- },
- data: formData,
- context: this,
- cache: false,
- contentType: false,
- processData: false,
- dataType: 'json',
- success: function (data) {
- $(".progress").hide();
- }
- });
- e.preventDefault();
- });
Add Comment
Please, Sign In to add comment