javascript - Cross Domain Resource Sharing of Glyphicons -
i writing normal asp.net mvc5 website razor. here, decided import font icons 1 our our other sites. therefore, called urls references.
however, when try this, error in chrome , ie, saying that
font origin 'http://xx.xxx.xx.xx' has been blocked loading cross-origin resource sharing policy: no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:49447' therefore not allowed access. response had http status code 404.
have run problem before wcf application. tried enabling cross domain using following code in web.config
<system.webserver> <httpprotocol> <customheaders> <add name="access-control-allow-origin" value="*" /> <add name="access-control-allow-headers" value="content-type" /> <add name="access-control-allow-methods" value="get, post, put, delete, options" /> </customheaders> </httpprotocol>
this didnt add header problem.
tried adding following code in home controller
response.appendheader("access-control-allow-origin", "*");
,
response.addheader("access-control-allow-origin", "*");
the font calling in base layout.
i'm confused if have done wrong.
is there way can javascript call force cross domain ?
Comments
Post a Comment