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
d89c278a
Commit
d89c278a
authored
Apr 04, 2014
by
Oleg Gaidarenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests: Fix failing ajax tests in oldIE
parent
4d5596e3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
14 deletions
+18
-14
test.html
test/data/test.html
+1
-1
test.php
test/data/test.php
+2
-2
testbar.php
test/data/testbar.php
+1
-1
ajax.js
test/unit/ajax.js
+13
-9
manipulation.js
test/unit/manipulation.js
+1
-1
No files found.
test/data/test.html
View file @
d89c278a
...
...
@@ -3,5 +3,5 @@ html text<br/>
testFoo
=
"foo"
;
jQuery
(
'#foo'
).
html
(
'foo'
);
ok
(
true
,
"test.html executed"
);
/* ]]> */
</script>
<script
src=
"data/test
.js
"
></script>
<script
src=
"data/test
bar.php
"
></script>
blabla
test/data/test.php
View file @
d89c278a
...
...
@@ -3,5 +3,5 @@ html text<br/>
testFoo
=
"foo"
;
jQuery
(
'#foo'
).
html
(
'foo'
);
ok
(
true
,
"test.php executed"
);
/* ]]> */
</script>
<script
src=
"data/test.js?
<?php
srand
();
echo
time
()
.
''
.
rand
();
?>
"
></script>
blabla
\ No newline at end of file
<script
src=
"data/testbar.php?
<?php
srand
();
echo
time
()
.
''
.
rand
();
?>
"
></script>
blabla
test/data/test
.js
→
test/data/test
bar.php
View file @
d89c278a
this
.
testBar
=
"bar"
;
jQuery
(
"#ap"
)
.
html
(
"bar"
);
ok
(
true
,
"test
.js
executed"
);
ok
(
true
,
"test
bar.php
executed"
);
test/unit/ajax.js
View file @
d89c278a
...
...
@@ -602,7 +602,7 @@ module( "ajax", {
ok
(
jQuery
.
get
(
url
(
target
),
success
),
"get"
);
ok
(
jQuery
.
post
(
url
(
target
),
success
),
"post"
);
ok
(
jQuery
.
getScript
(
url
(
"data/test
.js
"
),
success
),
"script"
);
ok
(
jQuery
.
getScript
(
url
(
"data/test
bar.php
"
),
success
),
"script"
);
ok
(
jQuery
.
getJSON
(
url
(
"data/json_obj.js"
),
success
),
"json"
);
ok
(
jQuery
.
ajax
({
url
:
url
(
target
),
...
...
@@ -850,7 +850,7 @@ module( "ajax", {
setup
:
function
()
{
Globals
.
register
(
"testBar"
);
},
url
:
window
.
location
.
href
.
replace
(
/
[^\/]
*$/
,
""
)
+
"data/test
.js
"
,
url
:
window
.
location
.
href
.
replace
(
/
[^\/]
*$/
,
""
)
+
"data/test
bar.php
"
,
dataType
:
"script"
,
success
:
function
()
{
strictEqual
(
window
[
"testBar"
],
"bar"
,
"Script results returned (GET, no callback)"
);
...
...
@@ -861,7 +861,7 @@ module( "ajax", {
setup
:
function
()
{
Globals
.
register
(
"testBar"
);
},
url
:
window
.
location
.
href
.
replace
(
/
[^\/]
*$/
,
""
)
+
"data/test
.js
"
,
url
:
window
.
location
.
href
.
replace
(
/
[^\/]
*$/
,
""
)
+
"data/test
bar.php
"
,
type
:
"POST"
,
dataType
:
"script"
,
success
:
function
(
data
,
status
)
{
...
...
@@ -874,7 +874,7 @@ module( "ajax", {
setup
:
function
()
{
Globals
.
register
(
"testBar"
);
},
url
:
window
.
location
.
href
.
replace
(
/
[^\/]
*$/
,
""
).
replace
(
/^.*
?\/\/
/
,
"//"
)
+
"data/test
.js
"
,
url
:
window
.
location
.
href
.
replace
(
/
[^\/]
*$/
,
""
).
replace
(
/^.*
?\/\/
/
,
"//"
)
+
"data/test
bar.php
"
,
dataType
:
"script"
,
success
:
function
()
{
strictEqual
(
window
[
"testBar"
],
"bar"
,
"Script results returned (GET, no callback)"
);
...
...
@@ -1776,7 +1776,7 @@ module( "ajax", {
asyncTest
(
"jQuery.getScript( String, Function ) - with callback"
,
2
,
function
()
{
Globals
.
register
(
"testBar"
);
jQuery
.
getScript
(
url
(
"data/test
.js
"
),
function
()
{
jQuery
.
getScript
(
url
(
"data/test
bar.php
"
),
function
()
{
strictEqual
(
window
[
"testBar"
],
"bar"
,
"Check if script was evaluated"
);
start
();
});
...
...
@@ -1784,12 +1784,12 @@ module( "ajax", {
asyncTest
(
"jQuery.getScript( String, Function ) - no callback"
,
1
,
function
()
{
Globals
.
register
(
"testBar"
);
jQuery
.
getScript
(
url
(
"data/test
.js
"
)
).
done
(
start
);
jQuery
.
getScript
(
url
(
"data/test
bar.php
"
)
).
done
(
start
);
});
asyncTest
(
"#8082 - jQuery.getScript( String, Function ) - source as responseText"
,
2
,
function
()
{
Globals
.
register
(
"testBar"
);
jQuery
.
getScript
(
url
(
"data/test
.js
"
),
function
(
data
,
_
,
jqXHR
)
{
jQuery
.
getScript
(
url
(
"data/test
bar.php
"
),
function
(
data
,
_
,
jqXHR
)
{
strictEqual
(
data
,
jqXHR
.
responseText
,
"Same-domain script requests returns the source of the script"
);
start
();
});
...
...
@@ -2017,7 +2017,9 @@ module( "ajax", {
strictEqual
(
data
,
"test%5Blength%5D=7&test%5Bfoo%5D=bar"
,
"Check if a sub-object with a length param is serialized correctly"
);
}
})
).
always
(
start
);
).
always
(
function
()
{
start
();
});
});
asyncTest
(
"jQuery.post( String, Hash, Function ) - simple with xml"
,
4
,
function
()
{
...
...
@@ -2040,7 +2042,9 @@ module( "ajax", {
strictEqual
(
jQuery
(
"result"
,
this
).
text
(),
"3"
,
"Check for XML"
);
});
})
).
always
(
start
);
).
always
(
function
()
{
start
();
});
});
//----------- jQuery.active
...
...
test/unit/manipulation.js
View file @
d89c278a
...
...
@@ -2348,7 +2348,7 @@ test( "script evaluation (#11795)", function() {
if
(
jQuery
.
ajax
)
{
Globals
.
register
(
"testBar"
);
jQuery
(
"#qunit-fixture"
).
append
(
"<script src='"
+
url
(
"data/test
.js
"
)
+
"'/>"
);
jQuery
(
"#qunit-fixture"
).
append
(
"<script src='"
+
url
(
"data/test
bar.php
"
)
+
"'/>"
);
strictEqual
(
window
[
"testBar"
],
"bar"
,
"Global script evaluation"
);
}
else
{
ok
(
true
,
"No jQuery.ajax"
);
...
...
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