Cross domain pdf loading

妖精的绣舞 提交于 2020-01-07 03:09:47

问题


I have a website with something like this: I have a folder with generated pdfs at http://www.example.com/mypdfs/mypdf.pdf; but then I need to load pdfs from there using javascript from http://subdomain.example.com which is subdomain in the same folder, but of course I am getting a crossdomain error, how can I solve this? how can I tell apache to allow cross domain access to this subdomain?.


回答1:


You'll need to modify your .htaccess file to allow cross domain origin, you need to add :

Header set Access-Control-Allow-Origin "*"

Enabling CORS in apache



来源:https://stackoverflow.com/questions/34109354/cross-domain-pdf-loading

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