Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery-在iframe中检测链接单击_Jquery_Iframe - Fatal编程技术网

jquery-在iframe中检测链接单击

jquery-在iframe中检测链接单击,jquery,iframe,Jquery,Iframe,iframe和父级位于同一个域上 我通常会这样做: $('a').click(function(e){ var href = $(this).attr("href"); alert(href); }); 如何在iframe中检测?这不是跨域的

iframe和父级位于同一个域上

我通常会这样做:

$('a').click(function(e){
    var href = $(this).attr("href");
    alert(href);
});

如何在iframe中检测?

这不是跨域的