我需要在做文件上傳後僅在發生圖像變化時發生事件。 我寫了下面的代碼。但它也觸發頁面加載。我不想要onload。我們如何實現它?僅在圖像變化時發生火災事件
$(document).ready(function() {
$('#Imgphoto1').on('load', function() {
alert();
top.IsfieldChange("1");
});
});
<asp:Image ID="Imgphoto1" runat="server" AlternateText="No Photo Available" ImageUrl="../Designer/Images/DefaultEmployeeImage.jpg"
Width="153" Height="192" />
<asp:FileUpload ID="FileUpload12" runat="server" onpropertychange='return setPhoto(id);' onchange="validcheckFileExtension(this);" ToolTip="Allowed files('.jpeg', '.png', '.gif', '.jpg')" />
共享所有相關代碼HTML CSS –