Solved

Using the SharePoint 2010 Client Object Model with JavaScript/JQuery

Posted on 2010-09-15
4
1,153 Views
Last Modified: 2012-05-10
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
Comment
Question by:MSEC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 33695078
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
 

Author Comment

by:MSEC
ID: 33695326
But I thought the whole point of the SharePoint Client Object Model was to expose the API to the client?
0
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 500 total points
ID: 33696308
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
 

Author Closing Comment

by:MSEC
ID: 33697336
Thanks.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question