Skip to content

Instantly share code, notes, and snippets.

@justinoboyle
Created November 24, 2015 00:14
Show Gist options
  • Select an option

  • Save justinoboyle/d06c90aaf38c9a38ef85 to your computer and use it in GitHub Desktop.

Select an option

Save justinoboyle/d06c90aaf38c9a38ef85 to your computer and use it in GitHub Desktop.
function pushState(e, t) {
history.pushState('', '', e);
var n = new XMLHttpRequest;
n.onreadystatechange = function() {
if (4 == n.readyState && 200 == n.status) {
for (var e = document.childNodes.length - 1; e >= 0;) document.removeChild(document.childNodes[e--]);
document.write(n.responseText), t()
}
}, n.open('GET', e, !0), n.send(null)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment