0
按我的要求,我希望有一個錨標記來觸發三個動作JavaScript函數和iframe調用
1)調用javascript函數 2)去HREF鏈接。 3)打開iframe中的鏈接
這裏是代碼。
<a target="frame1" href="subView" onclick="follow(event, this);">Hi</a>
<iframe name="frame1" src="Date.jsp">
</iframe>
<SCRIPT LANGUAGE="JavaScript">
function follow(e, item) {
e = e || window.event; //IE stuff
e.preventDefault(); //prevent link click triggering
e.returnValue = false; //also prevent link click triggering (old IE style)
alert(item.href);
// showBreadCrum(item.href);
}
</script>
我該如何實現它。因爲所有這三件事情不是同時發生的。
好的我得到了解決方案,如果我們註釋掉e的三行,那麼我們可以實現它。 e = e || window.event; // IE stuff e.preventDefault(); //防止鏈接點擊觸發 e.returnValue = false; –