I wanted to get the img src variable for php when the user clicks on it, so I used the jquery function to get the img src when the user clicks on this image. JQuery to get img src
$("img").click(function() { var ipath = $(this).attr('src'); })
now i tried something like this to get the ipath value for php variable
$.ajax({ type:'POST', url: 'sample.php', dataType: 'HTML', data: dataString, success: function(data) { } }); });
I'm not sure if Ajax is used correctly, can anyone help with the Ajax function to do this? Thanks.
source share