
Error - access-control-allow-origin
Publicado por Juan David Ochoa (3 intervenciones) el 21/06/2016 04:22:08
Saludos a todos, llevo días quebrandome la cabeza intentando de solucionar el siguiente error:
XMLHttpRequest cannot load http://real2.streaming-co.com:2199/recentfeed/juandavid/json/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://codigo2.tk' is therefore not allowed access.
Agradecería cualquier ayuda o luz que me puedan dar.
XMLHttpRequest cannot load http://real2.streaming-co.com:2199/recentfeed/juandavid/json/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://codigo2.tk' is therefore not allowed access.
Agradecería cualquier ayuda o luz que me puedan dar.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("http://real2.streaming-co.com:2199/recentfeed/juandavid/json/", function(resp){
console.log(resp);
$.each(resp.items, function(){
console.log(this['title']);
$("div").append(this['title'] + "<br>");
});
});
});
});
</script>
</head>
<body>
<button>Get JSON data</button>
<div></div>
</body>
</html>
Valora esta pregunta


0