Fixes #5856. Adds document protocol at the beginning of URLs without protocol (thanks...
[jquery.git] / test / unit / ajax.js
index abe90c8..2624b55 100644 (file)
@@ -415,6 +415,18 @@ test(".ajax() - contentType" , function() {
 
 });
 
+test(".ajax() - protocol-less urls", function() {
+       expect(1);
+
+       jQuery.ajax({
+               url: "//somedomain.com",
+               beforeSend: function( xhr, settings ) {
+                       equals(settings.url, location.protocol + "//somedomain.com", "Make sure that the protocol is added.");
+                       return false;
+               }
+       });
+});
+
 test(".ajax() - hash", function() {
        expect(3);