ajax - Delete an image without reloading a page -


I am using the function in my page. I am using this function to delete one or more uploaded images. The code is working fine, but when I click on the "delete" button, then reloading a page is it possible to delete images without reloading the page using the "post" method or Ajax?

  & lt; Div onclick = "delete_files_inmos1" ('Seguro de Elimminar el Archivo', 'im_Delete_Chk', 'Im_FileUp', 'im_imgf', '& lt; php echo $ url? & Gt;', Php echo $ this- & Gt; Config- & gt; Maximum file upload? & Gt; & lt ;? php $ count? & Gt;; & gt; delete & lt; / div & gt; & lt; script & gt; function delete_Files_Inmos1 , Varbase, varimginput, varimgg, urlbase, maximg, imgdelete) {if (confirmation)} {var obj; var imgsdelete = ''; obj = AJAX_MM_findObj (varbase + imgdelete); if (obj) obj.checked true =; For (I = 0; i & lt; maximg; i ++) (obj = AJAX_MM_findObj (varbase + i); If (obj) {if (obj.checked == true) {obj = AJAX_MM_findObj (varimginput + i) ; (Imgsdelete = '!') Imgsdelete = imgsdelete + '[]' if; imgsdelete = imgsdelete + obj.value;}}} Document.location = urlbase + '& amp; am P; + varimgg + '=' + imgsdelete;}} & lt; / script>    

You must return the false in your onclic function!


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -