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
e0b1bb8e
Commit
e0b1bb8e
authored
Jan 31, 2011
by
jaubourg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Script dataType now supports ecmascript mimetypes.
parent
f286a716
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
script.js
src/ajax/script.js
+2
-2
script.php
test/data/script.php
+5
-1
ajax.js
test/unit/ajax.js
+14
-8
No files found.
src/ajax/script.js
View file @
e0b1bb8e
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
// Install script dataType
// Install script dataType
jQuery
.
ajaxSetup
({
jQuery
.
ajaxSetup
({
accepts
:
{
accepts
:
{
script
:
"text/javascript, application/javascript"
script
:
"text/javascript, application/javascript
, application/ecmascript, application/x-ecmascript
"
},
},
contents
:
{
contents
:
{
script
:
/javascript/
script
:
/javascript
|ecmascript
/
},
},
converters
:
{
converters
:
{
"text script"
:
function
(
text
)
{
"text script"
:
function
(
text
)
{
...
...
test/data/script.php
View file @
e0b1bb8e
<?php
<?php
error_reporting
(
0
);
error_reporting
(
0
);
if
(
$_REQUEST
[
'header'
]
)
{
if
(
$_REQUEST
[
'header'
]
)
{
header
(
"Content-type: text/javascript"
);
if
(
$_REQUEST
[
'header'
]
==
"ecma"
)
{
header
(
"Content-type: application/ecmascript"
);
}
else
{
header
(
"Content-type: text/javascript"
);
}
}
}
?>
?>
ok( true, "Script executed correctly." );
ok( true, "Script executed correctly." );
test/unit/ajax.js
View file @
e0b1bb8e
...
@@ -1558,17 +1558,23 @@ test("jQuery.ajax() - malformed JSON", function() {
...
@@ -1558,17 +1558,23 @@ test("jQuery.ajax() - malformed JSON", function() {
});
});
test
(
"jQuery.ajax() - script by content-type"
,
function
()
{
test
(
"jQuery.ajax() - script by content-type"
,
function
()
{
expect
(
1
);
expect
(
2
);
stop
();
stop
();
jQuery
.
ajax
({
jQuery
.
when
(
url
:
"data/script.php"
,
data
:
{
header
:
"script"
},
jQuery
.
ajax
({
success
:
function
()
{
url
:
"data/script.php"
,
start
();
data
:
{
header
:
"script"
}
}
}),
});
jQuery
.
ajax
({
url
:
"data/script.php"
,
data
:
{
header
:
"ecma"
}
})
).
then
(
start
,
start
);
});
});
test
(
"jQuery.ajax() - json by content-type"
,
function
()
{
test
(
"jQuery.ajax() - json by content-type"
,
function
()
{
...
...
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