Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove <noscript> tags - Fixes #176 #177

Merged
merged 1 commit into from

2 participants

@reed
Collaborator

After changing the page, remove all <noscript> tags from the body. Prevents issue described in #176.

@dhh dhh merged commit 39764bc into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 2, 2013
  1. @reed

    Remove <noscript> tags

    reed authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/assets/javascripts/turbolinks.js.coffee
View
3  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
Something went wrong with that request. Please try again.