I am trying to access token from http://localhost:8090/appp/appp/getToken it returns me string with Content-Type:application/json on browser
I try to load this token using $.getJson from my wordpress application uploaded on url
but it does not return me that token
my code :
$.getJSON("http://localhost:8090/appp/appp/getToken",
{
format: "json"
},
function(token) {
alert(token);
});
Please help me
You will need to use jsonp since the domain is different from your page (due to the port number). The xhr request is considered cross domain and is falling foul of the same origin policy.
See the Additional Notes section from the jquery getJson docs