私は同様の質問を検索しましたが、私のために何かを見つけることができませんでした。Uncaught TypeError:ImageButtonにヌルの 'src'プロパティを設定できません。
特定の条件(t> 80)でImageButtonのImageURLを変更したいのですが、取得する内容はです。キャッチしないTypeError:nullのプロパティ 'src'を設定できません。私<head>
コードは次のとおりです。
$(document).ready(function() {
//doing other stuffs
setInterval(function() {
$(".industrial.tank.size.one").each(function() {
$(this).industrial(t);
if (t > 80) {
// document.getElementById('btnV11').ImageURL = "~/Images/Valve/Valve-gray-left.png";
document.getElementById('btnV11').src = "../../Images/Valve/Valve-gray-left.png";
});
}, 3000);
});
と<body>
に:
<asp:ImageButton ID="btnV11" runat="server" Height="51px" ImageUrl="~/Images/Valve/Valve-alarm-left.gif" Width="53px" OnClientClick="ShowControlPanel_P11(); return false;"/>
私はこのエラーが出るのはなぜ?
によって
のImageButtonは、その後、idはDOM – anomepani