Javascript examples for jQuery:Image
Show a image to visitor and delete that image from the server (on same page load)
<html> <head> <script src="jquery.min.js"> </script> </head> <body> <script> function unlinkImage(src) {//from www.ja va 2 s.co m $.ajax({ type:"POST", url: "delete.php", data:{ src:src } }).done(function() { console.log('done') }); } </script> <img src="http://www.java2s.com/style/download.png" onload="unlinkImage('someimage.png')"> </body> </html>