     value
 
   rememberReferer = ->
-    window.referer = document.location.href
+    referer = document.location.href
 
   processResponse = (responseText, status, headers)->
     clientOrServerError = ->

  loadedAssets = null
  createDocument = null
  xhr_req = null

  triggerEvent = (name, data) ->
    event = document.createEvent 'Events'

      method: 'GET',
      headers: {
        'Accept' : 'text/html, application/xhtml+xml, application/xml',
        'X-XHR-Referer' : referer
      },
      timeout: xhr_req.promise
    }).success((data, status, headers)->
