// Install script dataType
jQuery.ajaxSetup({
accepts: {
- script: "text/javascript, application/javascript"
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
- script: /javascript/
+ script: /javascript|ecmascript/
},
converters: {
"text script": function( text ) {
<?php
error_reporting(0);
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." );
});
test("jQuery.ajax() - script by content-type", function() {
- expect(1);
+ expect(2);
stop();
- jQuery.ajax({
- url: "data/script.php",
- data: { header: "script" },
- success: function() {
- start();
- }
- });
+ jQuery.when(
+
+ jQuery.ajax({
+ url: "data/script.php",
+ data: { header: "script" }
+ }),
+
+ jQuery.ajax({
+ url: "data/script.php",
+ data: { header: "ecma" }
+ })
+
+ ).then( start, start );
});
test("jQuery.ajax() - json by content-type", function() {