代码之家  ›  专栏  ›  技术社区  ›  RicardO

有没有一种方法可以运行jquery函数,即使尚未加载doms

  •  0
  • RicardO  · 技术社区  · 14 年前

    我在想,是否有一种方法可以运行jquery函数,比如$.post,即使尚未加载DOM。

    2 回复  |  直到 14 年前
        1
  •  1
  •   JAL    14 年前

    $(document).ready()

        2
  •  1
  •   TomWilde    14 年前

    function checkJquery(){
        if(typeof($)==undefined){
            setTimeout(checkJquery,500);
        } else {
            start();
        }
    }
    setTimeout(checkJquery,500);
    

    start()