jQuery在主页上添加Webpart [英] Jquery to Add Webpart on the homepage

查看:63
本文介绍了jQuery在主页上添加Webpart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好SharePoint Gurus –我需要为最终用户提供灵活性,以便以个性化模式将他们选择的Web部分添加到其主页上.我需要指导 就像在哪里开始编写相同的客户端脚本一样.

Hello  SharePoint  Gurus – I need to provide end users the flexibility to add the web part of their choice on their homepage in personalized mode.  I need guidance as where to start to write the client-side script for the same. 

感谢&问候

Khushi

推荐答案

Khushi,

Hi Khus

我们可以使用REST API或JSOM来实现它.

We can use REST API or JSOM to achieve it.

以下代码供您参考:

<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript">


(function(){ var webPartXml ='<?xml version ="1.0" encoding ="utf-8"?' + < WebPart xmlns =""http://schemas.microsoft.com/WebPart/v2">" + < Assembly> Microsoft.SharePoint,版本= 16.0.0.0,文化=中性,PublicKeyToken = 71e9bce111e9429c</Assembly>" + '< TypeName> Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>' + '< Title>
(function () { var webPartXml = '<?xml version="1.0" encoding="utf-8"?>' + '<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">' + '<Assembly>Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>' + '<TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>' + '<Title>


资源:core,ContentEditorWebPartTitle;</Title>' + '<说明>
Resources:core,ContentEditorWebPartTitle;</Title>' + '<Description>


这篇关于jQuery在主页上添加Webpart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆