   cacheCurrentPage()
 
   if page = pageCache[state.position]
+    xhr?.abort()
     changePage page.title, page.body
     recallScrollPosition page
     triggerEvent 'page:restore'

      else
        resetScrollPosition()
      triggerEvent 'page:load'
    xhr = null

  xhr.onerror = ->
    document.location.href = url
    xhr = null

  xhr.send()


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

  xhr?.abort()
  xhr = new XMLHttpRequest
  xhr.open 'GET', safeUrl, true
  xhr.setRequestHeader 'Accept', 'text/html, application/xhtml+xml, application/xml'
  xhr.setRequestHeader 'X-XHR-Referer', referer

  xhr.onload = =>
    doc = createDocument xhr.responseText

