Created
April 17, 2013 18:40
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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