0

I've been given admin privileges our team's SharePoint 2010 Subsite. However i'm not a SP developer.

  1. Can I use the Content Editor to access SharePoint Client Object Model?

  2. I'm looking to aggregate data from multiple lists across the subsite, geolocate them and integrate them display as a layer on ArcGIS JavaScript API. Are there any tutorials and/or examples for using the Client Object Model to do this?

  3. I've read a fair amount about ECMAScripts to access JavaScript APIs. How can I tell if my site has these? Or do I need to download and host them separately?

Thank you

1

2 Answers 2

0
  1. The Content Editor Webpart will allow you to add HTML and JavaScript in the page. One powerful feature of the CEWP is that you do not have to put your code inside it, you can link to any script file located within a Document Library.
    Code can do anything the logged in user is allowed to do.

  2. just search for JSOM, be aware that SharePoint 2010 had less advanced possibilities compared to SharePoint 2013, so example code might not work for you always.
    In SharePoint 2010 days we didn't use JSOM that much but still used the SOAP (XML) API to talk to SharePoint, Marc Anderson created the awesome SPServices (jQuery) library, a must for anyone doing SP2010 Front-End development: https://spservices.codeplex.com/

  3. Every SharePoint environment has those APIs, REST being the modern future proof one (but again.. SP2010 REST APIs are limited)
    So you do not need to load anything, just be aware SharePoint loads them for you, and with JSOM you have to wait executing your code till SP.js was loaded by SharePoint. You will see executeOrDelayUntilScriptLoaded in many examples

Tip

Start your developer experience in the F12 Dev Tools console of the Chrome browser. Under Sources/Snippets you can develop all your code you eventually want IN SharePoint. As long as you are logged into SharePoint you can code against SharePoint a lot faster then using WebParts and hitting F5 all the time.

https://developers.google.com/web/tools/chrome-devtools/javascript/snippets

0

Can I use the Content Editor to access SharePoint Client Object Model?

Anwser - Yes you can do this, ideally you should put your code in JS file refer that js file via content editor webpart or by just using classic ASPX page.

I'm looking to aggregate data from multiple lists across the subsite, geolocate them and integrate them display as a layer on ArcGIS JavaScript API. Are there any tutorials and/or examples for using the Client Object Model to do this?

Answer - http://www.codeproject.com/Articles/60348/SharePoint-Client-Object-Model-for-JavaScript

I've read a fair amount about ECMAScripts to access JavaScript APIs. How can I tell if my site has these? Or do I need to download and host them separately?

Answer - It is already available, you just have to refer or make sure that sp.js file is loaded.

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.