jQuery Ajax CORS Example
HTML
<div id="container">
<h2>Icons</h2>
<p>Loading...</p>
</div>
<button id="123">Click me</button>
CSS
img{
width:20px;
height:20px;
float:left;
margin:2px;
}
JavaScript
$('#123').click(function(event){
event.preventDefault();
var request = $.ajax({
url: "https://d30y9cdsu7xlg0.cloudfront.net/noun-svg/72.svg?Expires=1463509190&Signature=k7oHSkspqvqVTWzr9N5ehE65UmYxZkgk75fIQ0ovH46LzerJs1i~dCMluxFCfgrtZzXGJ4y5tPFW2dOHzpfrcUJLNs3MSUxx0RmfwQD5CMdSI6goKmvKoT34lgwu7g~TcpzQFOUnh0epPIFViqacqYoTL7ASk-~ywrCoUiYs19o_&Key-Pair-Id=APKAI5ZVHAXN65CHVU2Q",
type: "GET",
dataType: 'text'
});
request.done(function(response) {
$("p", "#container").hide();
console.log(response);
$("#container").append(response);
});
});