1

I've been racking my brain about this and I am hoping others may help. I have two host-name site collections http://site1 and http://site2. These are both within the same SharePoint Web Application and I have not built any SharePoint (or Provider) hosted apps.

I've added a JS script to one of the pages within http://site1 that needs to access information from http://site2 over AJAX (right now I am using jQuery). When trying to do this am getting a Cross Domain error from the browser.

Has anyone had any luck trying to add a simple ASPX page into the SharePoint 'Pages' library, adding a JS snippet which hits a document library from another site collection, that is under a different domain?

1
  • Did you try $.support.cors=true? Dec 30, 2016 at 12:15

1 Answer 1

0

CORS is something strictly enforced by browsers. Querying across site collections is only possible if the two site collections share the same hostname/domain. (e.g. https://sharepoint.fqdn.local/sitecollection1 and https://sharepoint.fqdn.local/sitecollection2).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.