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
8cbb4a0a
Commit
8cbb4a0a
authored
Dec 31, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified tests to show #746
parent
4c66f62a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
test.php
build/test/data/test.php
+1
-1
test2.php
build/test/data/test2.php
+3
-0
ajaxTest.js
src/ajax/ajaxTest.js
+12
-1
No files found.
build/test/data/test.php
View file @
8cbb4a0a
html
text
<
br
/>
html
text
<
br
/>
<
script
type
=
"text/javascript"
>/*
<!
[
CDATA
[
*/
<
script
type
=
"text/javascript"
>/*
<!
[
CDATA
[
*/
testFoo
=
"foo"
;
$
(
'#foo'
)
.
html
(
'foo'
);
testFoo
=
"foo"
;
$
(
'#foo'
)
.
html
(
'foo'
);
ok
(
true
,
"test.
html
executed"
);
ok
(
true
,
"test.
php
executed"
);
/* ]]> */
</
script
>
/* ]]> */
</
script
>
<
script
src
=
"data/test.js?<?php srand(); echo time() . '' . rand(); ?>"
></
script
>
<
script
src
=
"data/test.js?<?php srand(); echo time() . '' . rand(); ?>"
></
script
>
blabla
blabla
\ No newline at end of file
build/test/data/test2.php
0 → 100644
View file @
8cbb4a0a
<script
type=
"text/javascript"
>
testFoo
=
"foo"
;
$
(
'#foo'
).
html
(
'foo'
);
ok
(
true
,
"test2.php executed"
);
</script>
src/ajax/ajaxTest.js
View file @
8cbb4a0a
...
@@ -72,17 +72,28 @@ test("load(String, Object, Function) - check scripts", function() {
...
@@ -72,17 +72,28 @@ test("load(String, Object, Function) - check scripts", function() {
foobar
=
null
;
foobar
=
null
;
var
verifyEvaluation
=
function
()
{
var
verifyEvaluation
=
function
()
{
ok
(
foobar
==
"bar"
,
'Check if script src was evaluated after load'
);
ok
(
foobar
==
"bar"
,
'Check if script src was evaluated after load'
);
ok
(
$
(
'#foo'
).
html
()
==
'foo'
,
'Check if script evaluation has modified DOM'
);
ok
(
$
(
'#ap'
).
html
()
==
'bar'
,
'Check if script evaluation has modified DOM'
);
ok
(
$
(
'#ap'
).
html
()
==
'bar'
,
'Check if script evaluation has modified DOM'
);
start
();
start
();
};
};
$
(
'#first'
).
load
(
url
(
'data/test.php'
),
function
()
{
$
(
'#first'
).
load
(
url
(
'data/test.php'
),
function
()
{
ok
(
$
(
'#first'
).
html
().
match
(
/^html text/
),
'Check content after loading html'
);
ok
(
$
(
'#first'
).
html
().
match
(
/^html text/
),
'Check content after loading html'
);
ok
(
$
(
'#foo'
).
html
()
==
'foo'
,
'Check if script evaluation has modified DOM'
);
ok
(
testFoo
==
"foo"
,
'Check if script was evaluated after load'
);
ok
(
testFoo
==
"foo"
,
'Check if script was evaluated after load'
);
setTimeout
(
verifyEvaluation
,
600
);
setTimeout
(
verifyEvaluation
,
600
);
});
});
});
});
test
(
"load(String, Object, Function) - check file with only a script tag"
,
function
()
{
expect
(
3
);
stop
();
testFoo
=
undefined
;
$
(
'#first'
).
load
(
url
(
'data/test2.php'
),
function
()
{
ok
(
$
(
'#foo'
).
html
()
==
'foo'
,
'Check if script evaluation has modified DOM'
);
ok
(
testFoo
==
"foo"
,
'Check if script was evaluated after load'
);
start
();
});
});
test
(
"test global handlers - success"
,
function
()
{
test
(
"test global handlers - success"
,
function
()
{
expect
(
8
);
expect
(
8
);
stop
();
stop
();
...
...
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