I have the following function:
$("a#mylink").click(function(e){
e.preventDefault();
$.ajax({ url: $(this).attr("href") });
$(this).parent().parent().fadeOut("slow");
});
A link is being created on the page with the following code:
'<div style="margin-top: 4px; border: solid 2px #515151; color: #515151; width: 300px;"><span style="padding-left: 4px">' +
file.name+
' </span><div style="float: right; padding-right: 4px;"><a class="mylink" href="remove.aspx?img='+safeUrl+'">Remove</a></div>' +
'</div>'
When I click the link, a new page pops up and it does not hit my function. Any ideas?