Image slection under upate panel not work
The script after update panel refresh does not work
<script type="text/javascript">
$(function () {
$('[id*=fuUpload1]').change(function () {
if (typeof (FileReader) != "undefined") {
var dvPreview = $("[id*=dvPreview]");
var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.jpg|.jpeg|.gif|.png|.bmp)$/;
$($(this)[0].files).each(function () {
var file = $(this);
if (regex.test(file[0].name.toLowerCase())) {
var reader = new FileReader();
reader.onload = function (e) {
var img = $("<img />");
img.attr("style", "max-height:250px;width: 150px");
img.attr("src", e.target.result);
dvPreview.append(img);
}
reader.readAsDataURL(file[0]);
} else {
alert(file[0].name + " is not a valid image file.");
dvPreview.html("");
return false;
}
});
} else {
alert("This browser does not support HTML5 FileReader.");
}
});
});
</script>
<asp:FileUpload ID="fuUpload1" runat="server" multiple="multiple" />
<div id="dvPreview"></div>
please advice