I have a javascript file from remote server and it contains a variable which has data which I want to access.
Js file:
http://static.www.xxx.com/mydata/uXKojYEd9WXFpAasite/v4_3/3/d/itemjs
Js file contain code like below
var MyItemData={"counts":{"q":1,"a":1,"r":2,"ar":4,"rr":0,"dq":1,"da":1,"c":0,"sdsd":0},"active":true};
I've used below code but it's giving error for cross-origin request block.
var target = 'http://static.www.xxx.com/mydata/uXKojYEd9WXFpAasite/v4_3/3/d/itemjs';
jQuery.get(target, function(data) {
alert(data);
});
Any other way to get the data ?
Access-control-Allow-Origin
header to your ip or to*
.