Permalink
Browse files

Merge pull request #189 from reed/copy-script-tag-list

Copy script tag list by slicing
  • Loading branch information...
2 parents 0e66be9 + 6cd6e33 commit ab7841827e561ffb2eb7766ab70d8a40385311ab @reed reed committed Feb 28, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/assets/javascripts/turbolinks.js.coffee
@@ -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

0 comments on commit ab78418

Please sign in to comment.