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
32b066d3
Commit
32b066d3
authored
Mar 24, 2013
by
Michał Gołębiowski
Committed by
Dave Methvin
Apr 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13655. Add test for jQuery.ready.promise fallback load. Close gh-1209.
parent
70498775
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
dont_return.php
test/data/core/dont_return.php
+3
-0
dynamic_ready.html
test/data/core/dynamic_ready.html
+35
-0
core.js
test/unit/core.js
+5
-0
No files found.
test/data/core/dont_return.php
0 → 100644
View file @
32b066d3
<?php
sleep
(
10000
);
?>
test/data/core/dynamic_ready.html
0 → 100644
View file @
32b066d3
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<script
src=
"../../jquery.js"
></script>
<script>
var
$j
=
jQuery
.
noConflict
();
</script>
</head>
<body>
<iframe
id=
"dont_return"
src=
"dont_return.php"
></iframe>
<script>
var
timeoutId
,
$
,
timeoutFired
=
false
;
setTimeout
(
function
()
{
// Load another jQuery copy using the first one.
$j
.
getScript
(
"../../../dist/jquery.js"
,
function
()
{
$j
(
"#dont_return"
).
attr
(
"src"
,
"about:blank"
);
// document ready handled by the just-loaded jQuery copy.
$
(
function
()
{
clearTimeout
(
timeoutId
);
if
(
!
timeoutFired
)
{
window
.
parent
.
iframeCallback
(
true
);
}
});
});
timeoutId
=
setTimeout
(
function
()
{
timeoutFired
=
true
;
window
.
parent
.
iframeCallback
(
false
);
},
3000
);
});
</script>
</body>
</html>
test/unit/core.js
View file @
32b066d3
...
@@ -24,6 +24,11 @@ testIframeWithCallback( "Conditional compilation compatibility (#13274)", "core/
...
@@ -24,6 +24,11 @@ testIframeWithCallback( "Conditional compilation compatibility (#13274)", "core/
ok
(
$
(),
"jQuery executes"
);
ok
(
$
(),
"jQuery executes"
);
});
});
testIframeWithCallback
(
"document ready when jQuery loaded asynchronously (#13655)"
,
"core/dynamic_ready.html"
,
function
(
ready
)
{
expect
(
1
);
equal
(
true
,
ready
,
"document ready correctly fired when jQuery is loaded after DOMContentLoaded"
);
});
test
(
"jQuery()"
,
function
()
{
test
(
"jQuery()"
,
function
()
{
var
elem
,
i
,
var
elem
,
i
,
...
...
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