Reputation: 145
I am using cross domain data calls in my chrome extension. I have created a PHP function to make use of an API. So I'm making a call to this function using JSONP and expecting to get the values in return. But this is the error I'm getting in the console.
Can anyone help me with this. What is the problem here? What do I have to do? I do not have any experience with chrome extensions.
In my situation I think that only YouTube is blocking the content because it is expecting the cross domain connections to be HTTPS. So it's not allowing the cross domain calls. Well that's what I think. But if that problem can be solved using a background script. Can you please help with how to proceed?
Upvotes: 1
Views: 10168
Reputation: 11
I get the same problem like yours, and, I just change my AJAX URL to HTTPS, like this:
My old URL is
var url="http://fanyi.youdao.com/openapi.do?keyfrom=fgbnbb&key=1276642867&type=data&doctype=json&version=1.1&q="+txt;
And then, I change it to var url="https://fanyi.youdao.com/openapi.do?keyfrom=fgbnbb&key=1276642867&type=data&doctype=json&version=1.1&q="+txt;
,
and then, the problem is gone.
Upvotes: 1