$ .ready加载广告仍然会导致问题和阻止页面。你的意见?

时间:2014-05-16 04:38:05

标签: javascript jquery

所以,我认为这可能是一个典型的问题,其中第三方检索资产正在阻止我的页面。所以,我在页面最底部的iframe中进行了一系列的延迟加载,正好在/ body标签之前和文档中。在YET,页面上的一些(非第三方,我的页面)资产仍然没有加载..它几乎就像等待每个资产加载(这些第三方资产)......

有没有办法推迟我的资产加载 - 我正在做类似的事情:

$(document).ready(function(){
  var arryOFassetSources = ['item1','item2'];
  $.each( arryOFassetSources, function(){
       // here is where I load them either in an iframe or inline.. BUT either way
       // iframe or otherwise -- other content on my page is held up.
       // I basically hostfile a dummy request that hangs to achieve the "delay"
  })
})

</body>

I also tried wrapping the load in a setTimeout ala... with and without closure

$(document).ready(function(){
  var arryOFassetSources = ['item1','item2'];
  $.each( arryOFassetSources, function(){
       (function(s){
       setTimeout(function(){
       // here is where I load them either in an iframe or inline.. BUT either way
       // iframe or otherwise -- other content on my page is held up.
       // I basically hostfile a dummy request that hangs to achieve the "delay"
      }, 500 );
      )(key)
  })
})

</body>

有关将此内容加载到&#34; ready&#34;之后的任何想法或&#34; onload&#34;或任何其他可以阻止页面的东西。我猜我的一些页面是等待&#34;在readyState等..因此,等待这些第三方资产..任何欺骗页面或允许页面完成其负载然后加载我的资产的方法?

0 个答案:

没有答案