• <bdo id='TeL6Y'></bdo><ul id='TeL6Y'></ul>
      <i id='TeL6Y'><tr id='TeL6Y'><dt id='TeL6Y'><q id='TeL6Y'><span id='TeL6Y'><b id='TeL6Y'><form id='TeL6Y'><ins id='TeL6Y'></ins><ul id='TeL6Y'></ul><sub id='TeL6Y'></sub></form><legend id='TeL6Y'></legend><bdo id='TeL6Y'><pre id='TeL6Y'><center id='TeL6Y'></center></pre></bdo></b><th id='TeL6Y'></th></span></q></dt></tr></i><div id='TeL6Y'><tfoot id='TeL6Y'></tfoot><dl id='TeL6Y'><fieldset id='TeL6Y'></fieldset></dl></div>
    1. <tfoot id='TeL6Y'></tfoot>

      <small id='TeL6Y'></small><noframes id='TeL6Y'>

      <legend id='TeL6Y'><style id='TeL6Y'><dir id='TeL6Y'><q id='TeL6Y'></q></dir></style></legend>

      1. 将内容附加到动态创建的 iframe 会得到一个空的 iframe

        appending content into a dymanically created iframe gets an empty iframe(将内容附加到动态创建的 iframe 会得到一个空的 iframe)
        1. <i id='K1Qxv'><tr id='K1Qxv'><dt id='K1Qxv'><q id='K1Qxv'><span id='K1Qxv'><b id='K1Qxv'><form id='K1Qxv'><ins id='K1Qxv'></ins><ul id='K1Qxv'></ul><sub id='K1Qxv'></sub></form><legend id='K1Qxv'></legend><bdo id='K1Qxv'><pre id='K1Qxv'><center id='K1Qxv'></center></pre></bdo></b><th id='K1Qxv'></th></span></q></dt></tr></i><div id='K1Qxv'><tfoot id='K1Qxv'></tfoot><dl id='K1Qxv'><fieldset id='K1Qxv'></fieldset></dl></div>

              <small id='K1Qxv'></small><noframes id='K1Qxv'>

              <tfoot id='K1Qxv'></tfoot>
                <tbody id='K1Qxv'></tbody>

              <legend id='K1Qxv'><style id='K1Qxv'><dir id='K1Qxv'><q id='K1Qxv'></q></dir></style></legend>

                <bdo id='K1Qxv'></bdo><ul id='K1Qxv'></ul>

                  本文介绍了将内容附加到动态创建的 iframe 会得到一个空的 iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个如下的 jQuery 片段:

                  I have a jQuery snippet as below:

                  $.ajax({
                    ....
                    success: function(myContent) {
                      .....
                      $('<iframe id="myFrame" name="myFrame">').appendTo('body').ready(function(){
                        $('#myFrame').contents().find('body').append(myContent);
                      });
                      .....
                    });
                  }); 
                  

                  第一次触发事件时,只显示一个空的 iframe,但如果第二次触发事件,则内容成功附加到 iframe 中.这个片段中有任何明显的错误吗?

                  When the event is triggered at the first time, only an empty iframe displays, but if the event is triggered at the second time, content is appended into the iframe successfully. Any obvious error in this snippet?

                  推荐答案

                  我相信有些浏览器需要短暂的延迟才能识别新 iframe 的 DOM.使用超时应该可以工作:

                  I believe some browsers need a short delay for it to recognize the DOM of a new iframe. Using a timeout should work:

                  $('<iframe id="myFrame" name="myFrame">').appendTo("body").ready(function(){
                      setTimeout(function(){
                          $('#myFrame').contents().find('body').append(myContent);
                      },50);
                  });
                  

                  这篇关于将内容附加到动态创建的 iframe 会得到一个空的 iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ajax请求获取json数据并处理的实例代码 $.ajax({ type: 'GET', url: 'https://localhost:44369/UserInfo/EditUserJson',//请求数据 data: json,//传递数据 //dataType:'json/text',//预计服务器返回的类型 timeout: 3000,//请求超时的时间 //回调函数传参 suc
                  append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href
                  Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)
                  ExecJS::ProgramError: SyntaxError: Reserved word quot;functionquot;(ExecJS::ProgramError: SyntaxError: 保留字“function)
                  Infinite scroll and will_paginate appending the #39;next page#39; of items multiple times(无限滚动和 will_paginate 多次附加项目的“下一页)
                  Ajax call in rails 3.2.3 with will_paginate gem(使用 will_paginate gem 在 Rails 3.2.3 中调用 Ajax)

                        • <bdo id='U3RCe'></bdo><ul id='U3RCe'></ul>
                          • <i id='U3RCe'><tr id='U3RCe'><dt id='U3RCe'><q id='U3RCe'><span id='U3RCe'><b id='U3RCe'><form id='U3RCe'><ins id='U3RCe'></ins><ul id='U3RCe'></ul><sub id='U3RCe'></sub></form><legend id='U3RCe'></legend><bdo id='U3RCe'><pre id='U3RCe'><center id='U3RCe'></center></pre></bdo></b><th id='U3RCe'></th></span></q></dt></tr></i><div id='U3RCe'><tfoot id='U3RCe'></tfoot><dl id='U3RCe'><fieldset id='U3RCe'></fieldset></dl></div>
                              <tbody id='U3RCe'></tbody>

                            <small id='U3RCe'></small><noframes id='U3RCe'>

                          • <tfoot id='U3RCe'></tfoot><legend id='U3RCe'><style id='U3RCe'><dir id='U3RCe'><q id='U3RCe'></q></dir></style></legend>