Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #189 from reed/copy-script-tag-list
Browse files Browse the repository at this point in the history
Copy script tag list by slicing
  • Loading branch information
reed committed Feb 28, 2013
2 parents 0e66be9 + 6cd6e33 commit ab78418
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/assets/javascripts/turbolinks.js.coffee
Expand Up @@ -85,7 +85,8 @@ changePage = (title, body, runScripts) ->
triggerEvent 'page:change'

executeScriptTags = ->
for script in document.body.getElementsByTagName 'script' when script.type in ['', 'text/javascript']
scripts = Array::slice.call document.body.getElementsByTagName 'script'
for script in scripts when script.type in ['', 'text/javascript']
copy = document.createElement 'script'
copy.setAttribute attr.name, attr.value for attr in script.attributes
copy.appendChild document.createTextNode script.innerHTML
Expand Down

0 comments on commit ab78418

Please sign in to comment.