Created
May 8, 2017 04:36
-
-
Save sudheerDev/536862e351c819dd52a02d1ea34ef785 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function callAjax(url, callback){ | |
var xmlhttp; | |
// compatible with IE7+, Firefox, Chrome, Opera, Safari | |
xmlhttp = new XMLHttpRequest(); | |
xmlhttp.onreadystatechange = function(){ | |
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){ | |
callback(xmlhttp.responseText); | |
} | |
} | |
xmlhttp.open("GET", url, true); | |
xmlhttp.send(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment