Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
dbf4926e
Commit
dbf4926e
authored
Jan 15, 2013
by
Oleg
Committed by
Dave Methvin
Jan 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently clean up after .ready() handler, close gh-1135.
parent
1ad874f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
core.js
src/core.js
+6
-5
No files found.
src/core.js
View file @
dbf4926e
...
...
@@ -62,8 +62,9 @@ var
},
// The ready event handler and self cleanup method
DOMContentLoaded
=
function
()
{
document
.
removeEventListener
(
"DOMContentLoaded"
,
DOMContentLoaded
,
false
);
completed
=
function
()
{
document
.
removeEventListener
(
"DOMContentLoaded"
,
completed
,
false
);
window
.
removeEventListener
(
"load"
,
completed
,
false
);
jQuery
.
ready
();
};
...
...
@@ -770,13 +771,13 @@ jQuery.ready.promise = function( obj ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout
(
jQuery
.
ready
);
// Standards-based browsers support DOMContentLoaded
}
else
{
// Use the handy event callback
document
.
addEventListener
(
"DOMContentLoaded"
,
DOMContentLoad
ed
,
false
);
document
.
addEventListener
(
"DOMContentLoaded"
,
complet
ed
,
false
);
// A fallback to window.onload, that will always work
window
.
addEventListener
(
"load"
,
jQuery
.
ready
,
false
);
window
.
addEventListener
(
"load"
,
completed
,
false
);
}
}
return
readyList
.
promise
(
obj
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment