I've a custom SharePoint application page in which I've different user controls (or can even call as web parts) loaded.
Each control/web part pulls data from different data sources and renders the data. So when the page is requested all the controls get loaded sequentially with the data and taking more time to be delivered to the client.
What I need is iGoogle style of loading where the page gets delivered immediately and the different parts of the page (weather, sports news, stock details etc) load开发者_运维技巧 asynchronously (and in parallel) and pull the data.
We all know that Asp.Net Ajax cannot serve multiple asynchronous requests simultaneously. So I thought of the following options -
- User SharePoint Client Object Model to get data
- Using JQuery create ajax requests to the OOTB SharePoint services and get the data.
- Using JQuery create ajax requests a custom SharePoint web service and get the data you want
But here are the drawbacks of SP Client Object above -
- Client Object model works only with SP 2010
- Pulling data from another site is not possible
- Will work only within SharePoint pages
The idea of JQuery/SP Services is working only with IE. I'm not able to get it work with Firefox. I guess it should be an authentication issue. Also, cross-site scripting is not possible with JQuery/SP Services. I'm not aware of any other vulnerabilities/issues with this method.
Any insights on these?
A few options here.
- Use iframes to load your islands of content. The processing of the page inside of each iframe will occur on different threads on the server, and you can store the pages on the server where the data comes from (no cross domain issues). The browser itself will only process two downloads at a time from the same domain (including your iframes). The loading of your iframes may compete with other downloads (css/js/images). You can host the iframes on different domains, or write some logic in javascript to delay the loading of your iframes until after the other page assets have been downloaded (set the src of the iframe later).
- Use Silverlight as a shim for cross domain access. If you can put a clientaccesspolicy.xml file on the servers you are accessing, you can use Silverlight to retrieve your data cross domain and manipulate the DOM when the results come back.
- Use JQuery and JSONP to retrieve your data cross domain. You may need to write custom web services installed on your SharePoint boxes to return the data in this fashion.
What do you mean about cross-site issues with SPServices? The only problems I've ever experienced is going outside the Web Application, it should work fine cross-site within Same Web App. Even then you CAN use a page viewer web part to display SPServices data from another Web Application.
Maybe I'm just confused.
精彩评论