javascript - 需要与 document.ready 相反的 jQuery

标签 javascript jquery

我需要一个在页面加载之前触发一些 JavaScript 代码的函数。它与 document.ready 相反

有什么想法吗?

谢谢!

劳伦特

最佳答案

<html>
    <head>
       <script type="text/javascript">
              //code here will run when encountered...
              //to ensure jQuery not loaded you can do this:
              if ( typeof jQuery  == undefined ){
                  //jQuery be like not there.
              }
       </script>

        <title>My Page</title>
    </head>
    <body>
    </body>
</html>

关于javascript - 需要与 document.ready 相反的 jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20979586/

相关文章:

javascript - Angular 和 ng-repeat 指令

javascript - 数据未显示在新页面上

javascript - 在window.onload = function()之后协调多个Javascript文件按顺序加载

javascript - 选择行在 IE 中不显示正确数量的选定行

java - JERSEY 使用 jquery/AJAX 上传文件

javascript - 如何在 React with Typescript 中使用 Material UI 自定义主题

javascript - 获取所选文件的文件大小 xp :fileUpload in CSJS

javascript - 如何在 JavaScript 中使用异步函数分配对象值

jquery - jquery Append() 中的 if 语句

Javascript 动画 div 到其他 div 的位置?