Skip to content

Instantly share code, notes, and snippets.

@ledangtuanbk
Last active November 3, 2020 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ledangtuanbk/f24e192e81737ce53c31c4d580df9f55 to your computer and use it in GitHub Desktop.
Save ledangtuanbk/f24e192e81737ce53c31c4d580df9f55 to your computer and use it in GitHub Desktop.
(function() {
var script = document.createElement('script')
script.setAttribute("type", "text/javascript")
script.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js")
document.getElementsByTagName("head")[0].appendChild(script)
})();
// call method send request
function send(url)
{
console.log("test function");
console.log("ajax request to the resource which will require cors enabled");
$.ajax
({
dataType: "html",
url: url,
success: function(data)
{
console.log("log response on success");
console.log(data);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment