Abhilash J A

Abhilash J A

  • 528
  • 2.4k
  • 600.6k

How to set ajax result to javascript function parameter ?

May 1 2017 9:04 AM
I am working on mvc5 project. After save image on server, then I am dynamically binding its name with delete button. here is jquery code,
 
  1.  success: function (res) {  
  2.   
  3.                 var content = '<div id="' + res.fileName + '"><img id="' + res.imgId + '" src="' + res.imgFullPath + '" width="135" height="135"> <button onclick="return product.DeleteProImage("' + res.fileName + '")">Delete</button> <input type="hidden" value="' + res.fileName + '" name="img_' + res.id + '"></div>';  

Now dynamically binding div 'uploadedImages' looking below image.
 
 
 But, now I am click on the delete button it is not executing 'product.DeleteProImage('imagename')' fuction. How can I solve this issue ?
 

Answers (2)