我的页面上有一个 iframe。我想指定一个函数在该 iframe 的 SRC 更改时运行(即,有人单击 iframe 内的链接)。这可能吗?我试过:
$("#my-iframe").change(function() { ... });
但没有起火。
最佳答案
查看:
How do I fire an event when a iframe has finished loading in jQuery?
从该页面:
http://sykari.net/stuff/iframe/
和
$("#iFrameId").load(function (){
// do something once the iframe is loaded
});
关于jQuery - 在 iframe 导航上运行代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1188641/