开发者

Same origin policy javascript

I'm writing an NPAPI plugin that injects a script with a src located 开发者_Go百科at my server. After the injection, my plugin tries to call a function in the script. But this doesnt seem to work. I think the reason is the same origin policy, but im not sure how to overcome it.

The call to the function works if i inject the script code completely into the page from the plugin. The only situation it doesnt work is when i give a src and keep the script in my server.


NPAPI plugins are not limited by origin policies, AFAIK, but you may want to keep in mind that injecting the script tag into the body will not synchronously load the javascript file; you'll have to wait a bit before you'll be able to access it. I would guess that this is most likely your problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜