
  function wait (time) {
    var start = new Date().getTime()
    while (new Date().getTime() < start + time) continue
  }
  document.getElementById('sendAjax').addEventListener('click', function () {
    fetch('/json').then(function () {
      throw new Error('test error')
    }).catch(function () {
      wait(50)
      if (!disableAjaxHashChange) {
        window.location.hash = Math.random()
      }
    })
  })
</script>
</body>
</html>
