     handleClick event
 
 # Call Turbolinks.visit(url) from client code
-@Turbolinks = { visit: visit }+@Turbolinks = { visit: visit }

  event.initEvent 'page:change', true, true
  document.dispatchEvent event

replaceHTML = (html) ->
  doc = document.implementation.createHTMLDocument ""
  doc.open "replace"
  doc.write html
  doc.close()

  originalBody = document.body
  document.documentElement.appendChild doc.body, originalBody
  document.documentElement.removeChild originalBody


extractLink = (event) ->
  link = event.target
  link = link.parentNode until link is document or link.nodeName is 'A'
  link

crossOriginLink = (link) ->
