     link.href = url
   link.href.replace link.hash, ''
 
-triggerEvent = (name) ->
+triggerEvent = (name, data) ->
   event = document.createEvent 'Events'
+  event.data = data if data
   event.initEvent name, true, true
   document.dispatchEvent event
 



fetchReplacement = (url) ->
  triggerEvent 'page:fetch'

  # Remove hash from url to ensure IE 10 compatibility
  safeUrl = removeHash url


# Public API
#   Turbolinks.visit(url)
#   Turbolinks.pagesCached()
#   Turbolinks.pagesCached(20)
@Turbolinks = { visit, pagesCached }
