Is it safe to use $.support.cors = true; in jQuery?

前端 未结 3 585
盖世英雄少女心
盖世英雄少女心 2020-11-27 03:19

I was trying to hit a web service on a different domain using jQuery\'s ajax method. After doing some research it looks like it does not allow this is by design to prevent

3条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 03:45

    It can help only if you have CORS enabled in your browser but it isn't supported by jQuery yet:

    To enable cross-domain requests in environments that do not support cors yet but do allow cross-domain XHR requests (windows gadget, etc), set $.support.cors = true;. CORS WD

    Just setting this property to true can't cause security vulnerability.

提交回复
热议问题