此代码不会 运行 jquery-3.1.0.js

this code wont run on jquery-3.1.0.js

为什么这段代码不会 运行 在 JS 3.1.0 运行 本地(从 http://jquery.com/download/ ) but runs fine when I load it from http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js

下载)
<script>
$(window).load(function() {
$(".se-pre-con").fadeOut("slow");;
});
</script>

我很困惑...请帮忙...

您在这里使用的 jQuery http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js uses jQuery 1.6.1, while the jQuery that you've downloaded from https://jquery.com/download/ 使用 jQuery 3.

并且在 jQuery 3 here 的文档中说:

Breaking change: .load(), .unload(), and .error() removed

因此,您可以像这样使用 $(function() {}); 而不是使用 .load()

$(function() {
  // insert code here...
});

在 Jquery 3.0 版中删除了 load() 方法。

检查此 link 以了解 Jquery 3.0 版的更多更改 https://jquery.com/upgrade-guide/3.0/#breaking-change-load-unload-and-error-removed