File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,14 @@ jQuery.extend({
179179 // so we use the ActiveXObject when it is available
180180 // This function can be overriden by calling jQuery.ajaxSetup
181181 xhr : function ( ) {
182- return window . XMLHttpRequest && window . location . protocol !== "file:" || window . ActiveXObject ?
183- new window . XMLHttpRequest ( ) :
184- new window . ActiveXObject ( "Microsoft.XMLHTTP" ) ;
182+ if ( window . XMLHttpRequest && ( window . location . protocol !== "file:" || ! window . ActiveXObject ) ) {
183+ return new window . XMLHttpRequest ( ) ;
184+
185+ } else {
186+ try {
187+ return new window . ActiveXObject ( "Microsoft.XMLHTTP" ) ;
188+ } catch ( e ) { }
189+ }
185190 } ,
186191 accepts : {
187192 xml : "application/xml, text/xml" ,
@@ -326,6 +331,10 @@ jQuery.extend({
326331 // Create the request object
327332 var xhr = s . xhr ( ) ;
328333
334+ if ( ! xhr ) {
335+ return ;
336+ }
337+
329338 // Open the socket
330339 // Passing null username, generates a login popup on Opera (#2865)
331340 if ( s . username ) {
You can’t perform that action at this time.
0 commit comments