Ignore case of script tags to make sure they're removed. Fixes #5668. Thanks to Motty...
[jquery.git] / src / ajax.js
index df418eb..edb5c54 100644 (file)
@@ -1,7 +1,7 @@
 var jsc = now(),
-       rscript = /<script(.|\s)*?\/script>/g,
+       rscript = /<script(.|\s)*?\/script>/gi,
        rselectTextarea = /select|textarea/i,
-       rinput = /text|hidden|password|search/i,
+       rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
        jsre = /=\?(&|$)/,
        rquery = /\?/,
        rts = /(\?|&)_=.*?(&|$)/,
@@ -199,7 +199,7 @@ jQuery.extend({
                var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
                
                var jsonp, status, data,
-                       callbackContext = s.context || window,
+                       callbackContext = s.context || s,
                        type = s.type.toUpperCase();
 
                // convert data if not already a string