我有一些用 JAVA 编写的代码。在网页上,某个按钮被禁用,但如果我单击此禁用按钮,Internet Explorer 中会出现一个弹出窗口。相同的代码在 Firefox 中运行良好 禁用按钮在 Firefox 中运行良好,它在 IE 中也被禁用,但是在 IE 中单击禁用按钮时,预计只有在启用按钮时才会出现弹出窗口。
火狐版 - 14.0.1 IE - 7.0
代码
if(IbSilentState == "Yes" || IbPresentState == "Absent")
{
if(btnIbsPowerOn) btnIbsPowerOn.disabled = true;
if(btnIbsPowerOff) btnIbsPowerOff.disabled = true;
}
else
{
if(btnIbsPowerOn) btnIbsPowerOn.disabled = (IbPowerState == "On") ? true : false;
if(btnIbsPowerOff) btnIbsPowerOff.disabled = (IbPowerState == "Stand-by off") ? true : false;
}
if(IbSilentState == "Yes" || TsmPresentState == "Absent")
{
if(btnTsmPowerOn) btnTsmPowerOn.disabled = true;
if(btnTsmPowerOff) btnTsmPowerOff.disabled = true;
}
else
{
if(btnTsmPowerOn) btnTsmPowerOn.disabled = (TsmPowerState == "On") ? true : false;
if(btnTsmPowerOff) btnTsmPowerOff.disabled = (TsmPowerState == "Stand-by off") ? true : false;
}