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
a208222f
Commit
a208222f
authored
Jul 05, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the document.ready addEventListener issue.
parent
aaaa9eb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
event.js
event/event.js
+3
-3
No files found.
event/event.js
View file @
a208222f
...
@@ -12,7 +12,7 @@ jQuery.prototype.toggle = function(a,b) {
...
@@ -12,7 +12,7 @@ jQuery.prototype.toggle = function(a,b) {
// Figure out which function to execute
// Figure out which function to execute
this
.
last
=
this
.
last
==
a
?
b
:
a
;
this
.
last
=
this
.
last
==
a
?
b
:
a
;
// Make sure that clicks
don't pass through
// Make sure that clicks
stop
e
.
preventDefault
();
e
.
preventDefault
();
// and execute the function
// and execute the function
...
@@ -115,7 +115,7 @@ jQuery.prototype.ready = function(f) {
...
@@ -115,7 +115,7 @@ jQuery.prototype.ready = function(f) {
// Handle when the DOM is ready
// Handle when the DOM is ready
jQuery
.
ready
=
function
()
{
jQuery
.
ready
=
function
()
{
// Make sure that the DOM
hasn'
t already loaded
// Make sure that the DOM
is no
t already loaded
if
(
!
jQuery
.
isReady
)
{
if
(
!
jQuery
.
isReady
)
{
// Remember that the DOM is ready
// Remember that the DOM is ready
jQuery
.
isReady
=
true
;
jQuery
.
isReady
=
true
;
...
@@ -135,7 +135,7 @@ jQuery.prototype.ready = function(f) {
...
@@ -135,7 +135,7 @@ jQuery.prototype.ready = function(f) {
// If Mozilla is used
// If Mozilla is used
if
(
jQuery
.
browser
==
"mozilla"
||
jQuery
.
browser
==
"opera"
)
{
if
(
jQuery
.
browser
==
"mozilla"
||
jQuery
.
browser
==
"opera"
)
{
// Use the handy event callback
// Use the handy event callback
jQuery
.
event
.
add
(
document
,
"DOMContentLoaded"
,
jQuery
.
ready
);
document
.
addEventListener
(
"DOMContentLoaded"
,
jQuery
.
ready
,
false
);
// If IE is used, use the excellent hack by Matthias Miller
// If IE is used, use the excellent hack by Matthias Miller
// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
...
...
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