Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1173
  • Last Modified:

Using the SharePoint 2010 Client Object Model with JavaScript/JQuery

How can I loop through an SPWebCollection (WebCollection) object in JQuery/Javascript using the SharePoint 2010 Client Object Model?

I have a collection of Webs, and I want to look at each of them to see if they have a certain property (a custom property that I set).  What is the easiest way to do this on the client side, without refreshing the page?
0
MSEC
Asked:
MSEC
  • 2
  • 2
1 Solution
 
Ted BouskillSenior Software DeveloperCommented:
You cannot.  Access to the API is only available with managed code installed on the server.

You can use Sharepoint web services remotely to access site information but that is limited by the security permissions of the user and only reflects information available on the web UI.  It will not provide full access to the Sharepoint API.
0
 
MSECAuthor Commented:
But I thought the whole point of the SharePoint Client Object Model was to expose the API to the client?
0
 
Ted BouskillSenior Software DeveloperCommented:
Not exactly.  Full JavaScript access from the client is VERY risky.

JavaScript isn't intended for full web UI development and customization because as an interpreted language on the client it is slow, insecure and can be altered easily by people without the best intentions.

So, if you want to use AJAX type technology from the client you have to expose the server side data yourself in a controlled manner.

Sharepoint 2010 uses REST services to simplify this work but once again there are limits to protect the security of the system.
0
 
MSECAuthor Commented:
Thanks.
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now