Permalink
Browse files

Merge pull request #177 from reednj77/remove-noscript-tags

Remove <noscript> tags - Fixes #176
  • Loading branch information...
2 parents 2a0ea30 + c69c207 commit 39764bc3d09b503f4a11435df96694a4d1c82897 @dhh dhh committed Feb 3, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/assets/javascripts/turbolinks.js.coffee
@@ -79,6 +79,7 @@ constrainPageCacheTo = (limit) ->
changePage = (title, body, runScripts) ->
document.title = title
document.documentElement.replaceChild body, document.body
+ removeNoscriptTags()
executeScriptTags() if runScripts
currentState = window.history.state
triggerEvent 'page:change'
@@ -92,6 +93,8 @@ executeScriptTags = ->
parentNode.removeChild script
parentNode.insertBefore copy, nextSibling
+removeNoscriptTags = ->
+ noscript.parentNode.removeChild noscript for noscript in document.body.getElementsByTagName 'noscript'
reflectNewUrl = (url) ->
if url isnt document.location.href

0 comments on commit 39764bc

Please sign in to comment.