I am trying to load images dynamically and display them as shown below.
var uploader = $('#<%=uploader.ClientId%>').plupload('getUploader'); uploader.bind('FileUploaded', function (up, file, res) { $('#<%=thumbs.ClientId%>').append("<div id=" + file.id + "> <a href='Uploads/" + document.getElementById("<%=currentDirectory.ClientId%>").value + "/" + file.name + "'/> <img src='Uploads/" + document.getElementById("<%=currentDirectory.ClientId%>").value + "/" + file.name + "' width='70' height='55' data-full='Uploads/" + document.getElementById("<%=currentDirectory.ClientId%>").value + "/" + file.name + "'/></div>"); });
This is my markup:
<div id="thumbs" class="imgContain" runat="server"> </div>
If I do this on a div, it gives me a warning, but not on the image, but on the div:
$('.imgContain').click(function () { alert('You Clicked Me'); });
And I tried using this method, but it gives me a warning not even on the div.
$('.imgContain a').click(function () { alert('You Clicked Me'); });
So how do I do this?
coder
source share