Hi there,
I am having some issues with getting a variable from an onclick event with javascript.
$('#preview_logo').append('<img src="'+fileObj.filePath+'" height="100px" hspace="5" /> '+fileObj.name+' uploaded.<a href="javascript:;" id="dele_image" onclick="del_image('+fileObj.filePath+','+fileObj.name+');">Upload Different Image</a><br>');
This is for uploadify script for previewing an image that is uploaded, it creates the link fine, but won't trigger the function "del_image" unless I delete the parameters in the onclick, which leads me to believe it is something to do with my quoting.
Here is the function:
function del_image(item_a, item_b){
$("#logo_upUploader").show();
$("#uploadifyUp").show();
$.ajax({
type: "GET",
url: "plugin/delete_image.php",
data: "filepath="+item_a,
success: function(){
alert( item_b+" Deleted");
}
});
}
just hoping someone might be able to see where i went wrong.
Thanks a lot