JS on Tumblr: “Cross-Origin Resource Sharing policy” Error

淺唱寂寞╮ 提交于 2019-12-11 08:44:22

问题


I got a canvas jQuery pluing script on my tumblr theme,
I got this error on Chrome:

Cross-origin image load denied by Cross-Origin Resource Sharing policy.

Tumblr uploads images to http://static.tumblr.com/
Even there is no different domain between files and account,
Same location, same domain...

But why do I get that error?

Any solution?

Thank you!


回答1:


what epascarello said, subdomain != same domain

because you are on the same root-domain you could set the document.domain in your theme to static.tumblr.com if you dont need it for anything else (eg. tracking...)

document.domain = 'static.tumblr.com';

do that as early as can.



来源:https://stackoverflow.com/questions/14459894/js-on-tumblr-cross-origin-resource-sharing-policy-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!