From: Dave Methvin Date: Tue, 12 Sep 2017 16:40:00 +0000 (-0400) Subject: Ajax: Allow custom attributes when script transport is used X-Git-Tag: 3.4.0~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1f4375a34227f42570d2b72e190e51bcfb1e8597;p=jquery.git Ajax: Allow custom attributes when script transport is used Fixes gh-3028 Ref gh-2612 Useful, for example, to add `nonce`, `integrity`, or `crossorigin`. --- diff --git a/src/ajax/script.js b/src/ajax/script.js index 6e0d21e99..292627f7e 100644 --- a/src/ajax/script.js +++ b/src/ajax/script.js @@ -43,15 +43,15 @@ jQuery.ajaxPrefilter( "script", function( s ) { // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { - // This transport only deals with cross domain requests - if ( s.crossDomain ) { + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { var script, callback; return { send: function( _, complete ) { script = jQuery( "