rts = /([?&])_=[^&]*(&?)/,
rurl = /^(\w+:)?\/\/([^\/?#]+)/,
r20 = /%20/g,
+ rhash = /#[^#]*$/,
// Keep a copy of the old load method
_load = jQuery.fn.load;
var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
jsonp, status, data, type = s.type.toUpperCase();
+ s.url = s.url.replace( rhash, "" );
s.context = origSettings && origSettings.context || s;
// convert data if not already a string
});
});
+test(".ajax() - hash", function() {
+ expect(3);
+
+ jQuery.ajax({
+ url: "data/name.html#foo",
+ beforeSend: function( xhr, settings ) {
+ equals(settings.url, "data/name.html", "Make sure that the URL is trimmed.");
+ return false;
+ }
+ });
+
+ jQuery.ajax({
+ url: "data/name.html?abc#foo",
+ beforeSend: function( xhr, settings ) {
+ equals(settings.url, "data/name.html?abc", "Make sure that the URL is trimmed.");
+ return false;
+ }
+ });
+
+ jQuery.ajax({
+ url: "data/name.html?abc#foo",
+ data: { "test": 123 },
+ beforeSend: function( xhr, settings ) {
+ equals(settings.url, "data/name.html?abc&test=123", "Make sure that the URL is trimmed.");
+ return false;
+ }
+ });
+});
+
test(".ajax() - 304", function() {
expect( 1 );
stop();