1.这种写法:(function(){})(),同时注意:原生的异步对象的兼容性实例化方法

<script>
document.domain = "qq.com";
xmlHttp = (function() {
    var f;
    if(window.ActiveXObject) {
        f = function() { return new ActiveXObject('Microsoft.XMLHTTP');};
    } else if(window.XMLHttpRequest) {
        f = function() { return new XMLHttpRequest();};
    } else {
        f = function() { return;};
    }
    return f;
})();
说明:定义一个函数,然后执行调用这个函数
查看地址:(chrome浏览器)
view-source:http://radio.t.qq.com/proxy.html

拓展参考文章:https://www.cnblogs.com/wisdo/p/5074419.html

 2.页面尺寸大小变化,都修正iframe的高度。 


JS:
$(document).ready(function () { function fixHeight() { var headerHeight = $("#switcher").height(); $("#iframe").attr("height", $(window).height()-54+ "px"); } $(window).resize(function () { fixHeight(); }).resize(); });
HTML:

<div >
</iframe>
</div>
</div>

 

 

3. ... ...

相关文章:

  • 2021-05-25
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-08-21
猜你喜欢
  • 2021-05-19
  • 2021-09-14
  • 2021-08-25
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案