The best way to handle cross-domain on a SharePoint intranet without the server side, silverlight, DBC, etc.

I am working on an internal Microsoft SharePoint site and I need to retrieve the data from the list from the SharePoint site.

I don’t want to use Silverlight for various reasons, and connecting to business data is now impossible.

Is there an easy way to use JavaScript or something similar for this?

+7
source share
2 answers

"Simple?" Not really. Given your requirements, especially "without the server side", this is not possible.

However, if you can refuse this requirement, you have several options for including cross-domain requests.

CORS

decent support for Cross-resource sharing for XMLHttpRequest and Microsoft XDomainRequest . Although this will require that the remote server has the correct headers in the response so that your source / domain can make a request.

 <% Response.AddHeader("Access-Control-Allow-Origin", "*") %> 

Jsonp

A common option is JSONP , which loads the resource into <script> with the callback parameter with the name of the global function. Since JSON is based on JavaScript literals, this will not have the same problem with browser support, but the remote server will need to know how to build the output, and it is limited to GET requests.

 // <script src="http://other.dom/resource?callback=loadResource"></script> loadResource( [ {"id": 1, "name": "foo"}, {"id": 2, "name": "bar"} ] ); 

Server side proxy

If the remote server you are requesting for cannot (or will not) configure to support cross-domain requests, you will largely have to make a proxy server on the server side.

The general outline is described at AjaxPatters.org , and a number of .NET implementations can be found, including John Chapman's and the Cross-Domain Proxy Project .

+10
source

You can use jQuery to retrieve data from a SharePoint list. See this article.

-2
source

All Articles