@@ -70,6 +70,54 @@ test("jQuery.ajax() - success callbacks - (url, options) syntax", function() {
7070 } , 13 ) ;
7171} ) ;
7272
73+ ajaxTest ( "jQuery.ajax() - do not execute js (crossOrigin)" , 2 , function ( assert ) {
74+ return {
75+ create : function ( options ) {
76+ options . crossDomain = true ;
77+ return jQuery . ajax ( url ( "data/script.php?header=ecma" ) , options ) ;
78+ } ,
79+ success : function ( ) {
80+ assert . ok ( true , "success" ) ;
81+ } ,
82+ complete : function ( ) {
83+ assert . ok ( true , "complete" ) ;
84+ }
85+ } ;
86+ } ) ;
87+
88+ ajaxTest ( "jQuery.ajax() - execute js for crossOrigin when dataType option is provided" , 3 ,
89+ function ( assert ) {
90+ return {
91+ create : function ( options ) {
92+ options . crossDomain = true ;
93+ options . dataType = "script" ;
94+ return jQuery . ajax ( url ( "data/script.php?header=ecma" ) , options ) ;
95+ } ,
96+ success : function ( ) {
97+ assert . ok ( true , "success" ) ;
98+ } ,
99+ complete : function ( ) {
100+ assert . ok ( true , "complete" ) ;
101+ }
102+ } ;
103+ }
104+ ) ;
105+
106+ ajaxTest ( "jQuery.ajax() - do not execute js (crossOrigin)" , 2 , function ( assert ) {
107+ return {
108+ create : function ( options ) {
109+ options . crossDomain = true ;
110+ return jQuery . ajax ( url ( "data/script.php" ) , options ) ;
111+ } ,
112+ success : function ( ) {
113+ assert . ok ( true , "success" ) ;
114+ } ,
115+ complete : function ( ) {
116+ assert . ok ( true , "complete" ) ;
117+ }
118+ } ;
119+ } ) ;
120+
73121test ( "jQuery.ajax() - success callbacks (late binding)" , function ( ) {
74122 expect ( 8 ) ;
75123
0 commit comments