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
0477a6e9
Commit
0477a6e9
authored
Aug 25, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test case for "purple include", fixed a bug.
parent
34f10429
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
test3.html
build/test/data/test3.html
+3
-0
ajax.js
src/ajax/ajax.js
+4
-2
ajaxTest.js
src/ajax/ajaxTest.js
+9
-0
No files found.
build/test/data/test3.html
0 → 100644
View file @
0477a6e9
<div
class=
"user"
>
This is a user
</div>
<div
class=
"user"
>
This is a user
</div>
<div
class=
"teacher"
>
This is a teacher
</div>
src/ajax/ajax.js
View file @
0477a6e9
...
...
@@ -49,8 +49,10 @@ jQuery.fn.extend({
return
this
.
bind
(
"load"
,
url
);
var
off
=
url
.
indexOf
(
" "
);
var
selector
=
url
.
slice
(
off
,
url
.
length
);
url
=
url
.
slice
(
0
,
off
);
if
(
off
>=
0
)
{
var
selector
=
url
.
slice
(
off
,
url
.
length
);
url
=
url
.
slice
(
0
,
off
);
}
callback
=
callback
||
function
(){};
...
...
src/ajax/ajaxTest.js
View file @
0477a6e9
...
...
@@ -94,6 +94,15 @@ test("load(String)", function() {
$
(
'#first'
).
load
(
"data/name.html"
,
start
);
});
test
(
"load('url selector')"
,
function
()
{
expect
(
1
);
stop
(
true
);
// check if load can be called with only url
$
(
'#first'
).
load
(
"data/test3.html div.user"
,
function
(){
equals
(
$
(
this
).
children
(
"div"
).
length
,
2
,
"Verify that specific elements were injected"
);
start
();
});
});
test
(
"load(String, Function) - simple: inject text into DOM"
,
function
()
{
expect
(
2
);
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