Are AJAX calls to a sub-domain considered Cross Site Scripting?

后端 未结 2 1858
情深已故
情深已故 2020-12-14 15:32

I have Server A (www.example.com) sending information to Server B. I can only have HTML / JS on Server A (and have to do the \"crunching\" on Server B) so I\'m trying to sen

2条回答
  •  庸人自扰
    2020-12-14 16:19

    Short answer: No. See the Same Origin Policy

    You can only make an XHR request to the same host, port, and protocol.

    If you want to do Ajax without sticking to that, you can look at JSON-P.

    (XSS is a completely different kettle of fish, in which a site allows data to be injected into it (e.g. via a URI) that gets treated as JS allowing third parties to direct people to your site, while they are logged into it, and steal or edit data.)

提交回复
热议问题