给iframe 添加 onclick 事件 iframe onclick=
JS:[code] <script type="text/javascript">function setEvent() {
try {
for (var i = 0; i < window.frames.length; i++) {
// window.frames[i].document.onclick = function () {
window.frames[0].document.onclick = function () {
//window.open('/common/cpu.aspx'); //在新建窗口打开
window.location.href ='/common/cpu.aspx'; //在当前窗口打开
}
}
} catch (e) { }
timeHandle = setTimeout(setEvent, 500);
}
setEvent();
</script>[/code]HTML:[code]<iframe src="common/SystemStatusChart.aspx" style="margin-top:-0px;width:410px;height:225px;display:block;" border="0" scrolling="No" noresize="noresize" frameborder="0" onclick="setEvent()"></iframe>[/code]
页:
[1]