Skip to content

Instantly share code, notes, and snippets.

@mikedamm
Created April 17, 2013 18:40
Show Gist options
  • Save mikedamm/5406663 to your computer and use it in GitHub Desktop.
Save mikedamm/5406663 to your computer and use it in GitHub Desktop.
The worlds most awesome AJAX implementation. Every 2 seconds request the documents URL from the server and replace the entire DOM with the response.
$(document).ready(function() {
setTimeout(function() {
$.ajax({
cache: false
}).done(function(html) {
var newDoc = document.open("text/html", "replace");
newDoc.write(html);
newDoc.close();
});
}, 2000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment