From a7a1bd39e110ca2dc6c8e43ad0fa5969f4f6557a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 18 Jan 2016 20:01:59 +0100 Subject: [PATCH] Make sure we copy all script attributes over, including data- & more. --- jquery.pjax.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jquery.pjax.js b/jquery.pjax.js index bfcccce4..e1b38e23 100644 --- a/jquery.pjax.js +++ b/jquery.pjax.js @@ -773,9 +773,10 @@ function executeScriptTags(scripts) { if (matchedScripts.length) return var script = document.createElement('script') - var type = $(this).attr('type') - if (type) script.type = type - script.src = $(this).attr('src') + // Make sure we copy all attributes over, including data- & more. + $.each(this.attributes, function(i, attr) { + script.setAttribute(attr.name, attr.value) + }) document.head.appendChild(script) }) }