"isLocal": true,
"originaljQuery": true,
"$": true,
- "original$": true
+ "original$": true,
+ "externalHost": true,
}
}
<script>
var script = document.getElementsByTagName( "script" )[ 0 ],
div = document.createElement( "div" ),
- src = "http://google.com",
+ src = "http://" + window.parent.externalHost,
success = true,
error = "";
( error ? ": " + error : "" )
});
});
- </script>
+ </script>
</body>
</html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
body {
- background: url('http://s1.postimage.org/2d2r8xih0/body_background.png');
+ background: url('../1x1.jpg');
}
</style>
<script src="../../../dist/jquery.js"></script>
/*jshint multistr:true */
-var originaljQuery = this.jQuery || "jQuery",
+var amdDefined, fireNative,
+ originaljQuery = this.jQuery || "jQuery",
original$ = this.$ || "$",
hasPHP = true,
- // Disable Ajax tests to reduce network strain
- // Re-enabled (at least the variable should be declared)
isLocal = window.location.protocol === "file:",
- amdDefined;
+ // see RFC 2606
+ externalHost = "example.com";
// For testing .noConflict()
this.jQuery = originaljQuery;
deepEqual(f, q.apply( q, c ), a + " (" + b + ")");
}
-var createDashboardXML = function() {
+function createDashboardXML() {
var string = '<?xml version="1.0" encoding="UTF-8"?> \
<dashboard> \
<locations class="foo"> \
return jQuery.parseXML(string);
};
-var createWithFriesXML = function() {
+function createWithFriesXML() {
var string = '<?xml version="1.0" encoding="UTF-8"?> \
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> \
<soap:Body> \
- <jsconf xmlns="http://www.example.com/ns1"> \
- <response xmlns:ab="http://www.example.com/ns2"> \
+ <jsconf xmlns="http://{{ externalHost }}/ns1"> \
+ <response xmlns:ab="http://{{ externalHost }}/ns2"> \
<meta> \
<component id="seite1" class="component"> \
- <properties xmlns:cd="http://www.example.com/ns3"> \
+ <properties xmlns:cd="http://{{ externalHost }}/ns3"> \
<property name="prop1"> \
<thing /> \
<value>1</value> \
</soap:Body> \
</soap:Envelope>';
- return jQuery.parseXML(string);
+ return jQuery.parseXML( string.replace( /\{\{\s*externalHost\s*\}\}/g, externalHost ) );
};
-var createXMLFragment = function() {
+function createXMLFragment() {
var xml, frag;
if ( window.ActiveXObject ) {
xml = new ActiveXObject("msxml2.domdocument");
return frag;
};
-var fireNative;
-if ( document.createEvent ) {
- fireNative = function( node, type ) {
+fireNative = document.createEvent ?
+ function( node, type ) {
var event = document.createEvent('HTMLEvents');
event.initEvent( type, true, true );
node.dispatchEvent( event );
- };
-} else {
- fireNative = function( node, type ) {
+ } :
+ function( node, type ) {
var event = document.createEventObject();
node.fireEvent( 'on' + type, event );
};
-}
/**
* Add random number to url to stop caching
).appendTo( "body" );
});
};
+
+ window.iframeCallback = undefined;
}());
// Sandbox start for great justice
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
- <jsconf xmlns="http://www.example.com/ns1">
- <response xmlns:ab="http://www.example.com/ns2">
+ <jsconf xmlns="http://example.com/ns1">
+ <response xmlns:ab="http://example.com/ns2">
<meta>
<component id="seite1" class="component">
- <properties xmlns:cd="http://www.example.com/ns3">
+ <properties xmlns:cd="http://example.com/ns3">
<property name="prop1">
<thing />
<value>1</value>
jQuery.ajax({
dataType: "jsonp",
- url: loc.protocol + "//somewebsitethatdoesnotexist-656329477541.com:" + ( loc.port || 80 ),
+ url: loc.protocol + "//example.invalid:" + ( loc.port || 80 ),
beforeSend: function( _, s ) {
ok( s.crossDomain, "Test different hostnames are detected as cross-domain" );
return false;
var i = 1;
jQuery.ajax({
- url: "http://somewebsitethatdoesnotexist-67864863574657654.com",
+ // see RFC 2606
+ url: "http://example.invalid",
success: function() {
ok( false, "success" );
},
var i = 1;
jQuery.ajax({
- url: "http://www.google.com",
+ url: "http://" + externalHost,
success: function() {
ok( false, "success" );
},
equal( jQuery( option ).attr("selected"), "selected", "Make sure that a single option is selected, even when in an optgroup." );
- var $img = jQuery("<img style='display:none' width='215' height='53' src='http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif'/>").appendTo("body");
+ var $img = jQuery("<img style='display:none' width='215' height='53' src='data/1x1.jpg'/>").appendTo("body");
equal( $img.attr("width"), "215", "Retrieve width attribute an an element with display:none." );
equal( $img.attr("height"), "53", "Retrieve height attribute an an element with display:none." );
var $$ = jQuery;
- equal( jQuery, jQuery.noConflict(), "noConflict returned the jQuery object" );
- equal( window["jQuery"], $$, "Make sure jQuery wasn't touched." );
- equal( window["$"], original$, "Make sure $ was reverted." );
+ strictEqual( jQuery, jQuery.noConflict(), "noConflict returned the jQuery object" );
+ strictEqual( window["jQuery"], $$, "Make sure jQuery wasn't touched." );
+ strictEqual( window["$"], original$, "Make sure $ was reverted." );
jQuery = $ = $$;
- equal( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" );
- equal( window["jQuery"], originaljQuery, "Make sure jQuery was reverted." );
- equal( window["$"], original$, "Make sure $ was reverted." );
- ok( $$("#qunit-fixture").html("test"), "Make sure that jQuery still works." );
+ strictEqual( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" );
+ strictEqual( window["jQuery"], originaljQuery, "Make sure jQuery was reverted." );
+ strictEqual( window["$"], original$, "Make sure $ was reverted." );
+ ok( $$().pushStack([]), "Make sure that jQuery still works." );
window["jQuery"] = jQuery = $$;
});
test("can't get css for disconnected in IE<9, see #10254 and #8388", function() {
expect( 2 );
- var span = jQuery( "<span/>" ).css( "background-image", "url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif)" );
+ var span = jQuery( "<span/>" ).css( "background-image", "url(data/1x1.jpg)" );
notEqual( span.css( "background-image" ), null, "can't get background-image in IE<9, see #10254" );
var div = jQuery( "<div/>" ).css( "top", 10 );