相关疑难解决方法(0)

jQuery iframe load()事件?

有谁知道是否有这样的事情?

我有一个插入的iframe,$.ajax()我想在iframe的内容完全加载后做一些事情:

....
 success: function(html){  // <-- html is the IFRAME (#theiframe)
          $(this).html(html);   // $(this) is the container element
          $(this).show();
          $('#theiframe').load(function(){
             alert('loaded!');
          } 
....
Run Code Online (Sandbox Code Playgroud)

它工作,但我看到IFRAME被加载两次(警报也显示两次).

javascript ajax iframe jquery

51
推荐指数
3
解决办法
17万
查看次数

标签 统计

ajax ×1

iframe ×1

javascript ×1

jquery ×1