I have two code snippets:
$.getJSON("https://noembed.com/embed", {"format": "json", "url": input.val()}, function (data) {
// work with data
});
The second one:
$.getJSON("https://www.youtube.com/oembed", {"format": "json", "url": input.val()}, function (data) {
// work with data
});
The first one will be successful, but the second one not. They were both sent from http://localhost:8080/myapp/page
. Why does the same origin policy not permit both requests? (Actually it's question about browsers).