javascript - DropZone.js how to prevent refresh page after upload complete? -


i using dropzone.js in web application , facing problem page refreshed when upload complete , want everythin ajax, code: `

$(selector).dropzone( {   autoprocessqueue:false,   url:"uploadtraineravatar.php",   dictdefaultmessage:"upload photo",   acceptedfiles:'image/jpeg',   addremovelinks: true,   resizeheight:200,   resizewidth:200,     init: function() {         // using closure.       var _this = this;       dropzoneinstance=this;        this.on("complete",function(file){           _this.removefile(file);       })       this.on("success",function(file){                 alert("success");       })         this.on("sending", function(file,xhr,formdata) {        // alert('sending file' +  file.name)         id =  $(_this).attr("rowid");         if(id!=="undefined")            if(id!=='')                 formdata.append("rowid",id);          console.log($(_this));       });        this.on("addedfile",function(file){            if(file.type.indexof("png")!==-1)           {                   showpopupmessage("invalid image file","image file must .jpg or.jpeg",                   function (){                       _this.removefile(file);                   })           }       });    }   }); 

` when select photo upload , after upload success page refreshed how can prevent behavior?


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -