aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation/_evalUrl.js
blob: 1ed033673c7d02c57ee5601383e76c536d833d1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
define( [
	"../ajax"
], function( jQuery ) {

"use strict";

jQuery._evalUrl = function( url ) {
	return jQuery.ajax( {
		url: url,

		// Make this explicit, since user can override this through ajaxSetup (#11264)
		type: "GET",
		dataType: "text",
		cache: true,
		async: false,
		global: false,
		"throws": true,

		// Only evaluate the response if it is successful (gh-4126)
		success: function( text ) {
			jQuery.globalEval( text );
		}
	} );
};

return jQuery._evalUrl;

} );