MOSS 2010:Visual Studio 2010开发体验(19)——ECMAScript Object Model(一)

ECMAScript ClIEnt OM is SharePoint 2010 client object model extension for using with JavaScript or JScript. Few points to notice about ECMAScript Client OM:

  ECMAScript object model can only be used in SharePoint sites. So you can’t use this object model in an asp.net site to access SharePoint resources deployed in another url as this is cross-site scripting and not allowed. (这个对象模型是只能用在SharePoint页面内部,不能用在单独的网站中。而且也不能跨站访问外部资源)

  You can’t use this object model in a SharePoint site to access resources in different SharePoint sites(i.e., different urls). For example, from mysite.mysp.com you can access resources in yoursite.yoursp.com using ECMAScript client OM. This is also cross-site scripting. (即便是在SharePoint的不同站点中,也不能互相访问,其实这也是一种跨站访问)

  You can use JQuery with ECMAScript Client OM and for this you don’t need to do some extra work. All you need to do to use JQuery is to add reference to JQuery.js file and start using JQuery. (可以配合jquery使用该对象模型)

  You can use this ECMAScript Client OM in web part pages or application pages (aspx pages) by referencing a javascript file (SP.js). You don’t need to add reference to the file manually rather use <SharePoint:ScriptLink Name=”sp.js” ………. />. The file is located on the path “Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS”(我们可以在WebPart页面或者Application页面中使用该模型,但无需直接添加对其脚本文件SP.JS的引用,而是可以通过一个所谓的链接即可)

posted @ 2012-03-17 22:14  江南轻舞飞扬  阅读(153)  评论(0编辑  收藏  举报