0

Is there any reason why this code wont run on JS 3.1.0 running locally ( downloaded from 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>

I'm confuse... please help...

guest271314
  • 1
  • 15
  • 104
  • 177
The Naga Tanker
  • 441
  • 1
  • 4
  • 17

2 Answers2

1

The jQuery that you're using here 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/ uses jQuery 3.

And in the documentation of jQuery 3 here, it says:

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

So instead of using .load() you can just use $(function() {}); like this:

$(function() {
  // insert code here...
});
prtdomingo
  • 971
  • 4
  • 14
1

The load() method is removed in Jquery version 3.0.

Check this link for more changes on Jquery version 3.0 https://jquery.com/upgrade-guide/3.0/#breaking-change-load-unload-and-error-removed