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
b721a2f4
Commit
b721a2f4
authored
Dec 17, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a fix for bug #2020 - if you want to do data: {callback: "?"}, do jsonp: "callback" instead.
parent
45e4a52c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
ajax.js
src/ajax.js
+1
-1
ajax.js
test/unit/ajax.js
+3
-3
No files found.
src/ajax.js
View file @
b721a2f4
...
@@ -151,7 +151,7 @@ jQuery.extend({
...
@@ -151,7 +151,7 @@ jQuery.extend({
lastModified
:
{},
lastModified
:
{},
ajax
:
function
(
s
)
{
ajax
:
function
(
s
)
{
var
jsonp
,
jsre
=
/=
(\?
|%3F
)
/g
,
status
,
data
;
var
jsonp
,
jsre
=
/=
\?(
&|$
)
/g
,
status
,
data
;
// Extend the settings, but re-extend 's' so that it can be
// Extend the settings, but re-extend 's' so that it can be
// checked again later (in the test suite, specifically)
// checked again later (in the test suite, specifically)
...
...
test/unit/ajax.js
View file @
b721a2f4
...
@@ -449,7 +449,7 @@ test("$.ajax() - JSONP, Local", function() {
...
@@ -449,7 +449,7 @@ test("$.ajax() - JSONP, Local", function() {
$
.
ajax
({
$
.
ajax
({
url
:
"data/jsonp.php"
,
url
:
"data/jsonp.php"
,
dataType
:
"jsonp"
,
dataType
:
"jsonp"
,
data
:
{
callback
:
"?"
}
,
jsonp
:
"callback"
,
success
:
function
(
data
){
success
:
function
(
data
){
ok
(
data
.
data
,
"JSON results returned (GET, data obj callback)"
);
ok
(
data
.
data
,
"JSON results returned (GET, data obj callback)"
);
plus
();
plus
();
...
@@ -492,7 +492,7 @@ test("$.ajax() - JSONP, Local", function() {
...
@@ -492,7 +492,7 @@ test("$.ajax() - JSONP, Local", function() {
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
"data/jsonp.php"
,
url
:
"data/jsonp.php"
,
data
:
{
callback
:
"?"
}
,
jsonp
:
"callback"
,
dataType
:
"jsonp"
,
dataType
:
"jsonp"
,
success
:
function
(
data
){
success
:
function
(
data
){
ok
(
data
.
data
,
"JSON results returned (POST, data obj callback)"
);
ok
(
data
.
data
,
"JSON results returned (POST, data obj callback)"
);
...
@@ -558,7 +558,7 @@ test("$.ajax() - JSONP, Remote", function() {
...
@@ -558,7 +558,7 @@ test("$.ajax() - JSONP, Remote", function() {
$
.
ajax
({
$
.
ajax
({
url
:
base
+
"data/jsonp.php"
,
url
:
base
+
"data/jsonp.php"
,
dataType
:
"jsonp"
,
dataType
:
"jsonp"
,
data
:
{
callback
:
"?"
}
,
jsonp
:
"callback"
,
success
:
function
(
data
){
success
:
function
(
data
){
ok
(
data
.
data
,
"JSON results returned (GET, data obj callback)"
);
ok
(
data
.
data
,
"JSON results returned (GET, data obj callback)"
);
plus
();
plus
();
...
...
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