可能重複:
How to add click event to a iframe with JQueryclick事件對iframe無效?
我想要一個click事件添加到我的iframe,但它似乎沒有工作?
代碼:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$('#iframe_id').bind('click', function (event) { alert('hi'); });
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe id="iframe_id" src="http://www.google.com"></iframe>
</div>
</form>
</body>
</html>
上的I幀Click事件是由內部框架本身,而不是父窗口節點抓獲。所以'
http://stackoverflow.com/questions/7170698/track-clicks-inside-iframe-with-jquery – tekknolagi
http://stackoverflow.com/questions/6803251/jquery-click-tracking-not-working-on-iframe – tekknolagi