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
ee845c49
Commit
ee845c49
authored
Oct 25, 2010
by
John Resig
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://github.com/rwldrn/jquery
parents
36143ce6
3b50eaca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
ajax.js
src/ajax.js
+6
-0
event.js
src/event.js
+3
-0
ajax.js
test/unit/ajax.js
+15
-0
event.js
test/unit/event.js
+20
-0
No files found.
src/ajax.js
View file @
ee845c49
...
@@ -208,6 +208,12 @@ jQuery.extend({
...
@@ -208,6 +208,12 @@ jQuery.extend({
s
.
data
=
jQuery
.
param
(
s
.
data
,
s
.
traditional
);
s
.
data
=
jQuery
.
param
(
s
.
data
,
s
.
traditional
);
}
}
// If the jsonpCallback has been set, we can assume that dataType is jsonp
// Ticket #5803
if
(
s
.
jsonpCallback
)
{
s
.
dataType
=
"jsonp"
;
}
// Handle JSONP Parameter Callbacks
// Handle JSONP Parameter Callbacks
if
(
s
.
dataType
===
"jsonp"
)
{
if
(
s
.
dataType
===
"jsonp"
)
{
if
(
type
===
"GET"
)
{
if
(
type
===
"GET"
)
{
...
...
src/event.js
View file @
ee845c49
...
@@ -32,6 +32,9 @@ jQuery.event = {
...
@@ -32,6 +32,9 @@ jQuery.event = {
if
(
handler
===
false
)
{
if
(
handler
===
false
)
{
handler
=
returnFalse
;
handler
=
returnFalse
;
}
else
if
(
!
handler
)
{
// Fixes bug #7229. Fix recommended by jdalton
return
;
}
}
var
handleObjIn
,
handleObj
;
var
handleObjIn
,
handleObj
;
...
...
test/unit/ajax.js
View file @
ee845c49
...
@@ -799,6 +799,21 @@ test("jQuery.ajax() - JSONP, Local", function() {
...
@@ -799,6 +799,21 @@ test("jQuery.ajax() - JSONP, Local", function() {
plus
();
plus
();
}
}
});
});
// Supports Ticket #5803
jQuery
.
ajax
({
url
:
"data/jsonp.php"
,
jsonpCallback
:
"jsonpResults"
,
success
:
function
(
data
){
ok
(
data
.
data
,
"JSON results returned without dataType:jsonp when jsonpCallback is defined"
);
plus
();
},
error
:
function
(
data
){
ok
(
false
,
"Ajax error JSON (GET, custom callback name)"
);
plus
();
}
});
});
});
test
(
"JSONP - Custom JSONP Callback"
,
function
()
{
test
(
"JSONP - Custom JSONP Callback"
,
function
()
{
...
...
test/unit/event.js
View file @
ee845c49
module
(
"event"
);
module
(
"event"
);
test
(
"null or undefined handler"
,
function
()
{
expect
(
2
);
// Supports Fixes bug #7229
try
{
jQuery
(
"#firstp"
).
click
(
null
);
ok
(
true
,
"Passing a null handler will not throw an exception"
);
}
catch
(
e
)
{}
try
{
jQuery
(
"#firstp"
).
click
(
undefined
);
ok
(
true
,
"Passing an undefined handler will not throw an exception"
);
}
catch
(
e
)
{}
});
test
(
"bind(), with data"
,
function
()
{
test
(
"bind(), with data"
,
function
()
{
expect
(
3
);
expect
(
3
);
var
handler
=
function
(
event
)
{
var
handler
=
function
(
event
)
{
...
...
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