In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Blog link: https://blog.51cto.com/13969817
In order to increase the use of SharePoint by business people, many companies usually look for ways to enhance the functions of SharePoint. In fact, JavaScript can also help you provide better features and a relatively good user experience in SharePoint. Next, I will share with you the vast world of SharePoint using JavaScript, and the view unlocks the magic veil of Javascript and SharePoint.
So what is Javascript? It is a programming language, it can achieve complex functions on the web page, the web page no longer shows you simple static information, but real-time content updates, interactive maps, 2D, 3D animation, scrolling videos and so on. The vast majority of basic web pages are composed of three parts:
Content, image or text, or anything on a page, where HTMLCSS describes the appearance, font, color, size and location on the page of the content, behavior or interactivity on the page, what happens when you click or hover over anything you do, this is JavaScript, which enables and controls all the online interactions we know and love.
The actual JavaScript code is saved in a separate .js file, called when needed and run on the Web page, it is important to note that you cannot embed JavaScript in SharePoint Modern Page, so if you want to have more control over your site, you need to use Classic Page.
Now let's take adding fields to the list as an example to illustrate how SharePoint uses JavaScript?
Function addFieldToList (siteUrl) {
Var clientContext = new SP.ClientContext (siteUrl)
Var oList = clientContext.get_web (). Get_lists (). GetByTitle ('Announcements'); this.oField = oList.get_fields (). AddFieldAsXml ('', true, SP.AddFieldOptions.defaultValue); var fieldNumber = clientContext.castTo (oField,SP.FieldNumber); fieldNumber.set_maximumValue (100); fieldNumber.set_minimumValue (35); fieldNumber.update (); clientContext.load (oField); clientContext.executeQueryAsync (Function.createDelegate (this, this.onQuerySucceeded), Function.createDelegate (this, this.onQueryFailed))
}
Function onQuerySucceeded () {
Var result = oField.get_title () + 'added.'
Alert (result)
}
Function onQueryFailed (sender, args) {
Alert ('Request failed.' + args.get_message () +
'\ n' + args.get_stackTrace ())
}
Description: use the add (field) or addFieldAsXml (schemaXml, addToDefaultView, options) functions of the FieldCollection object to add fields to the field collection of the list. The following example creates a field and then updates it before calling executeQueryAsync (succeededCallback, failedCallback).
Related references: SharePoint .NET server, CSOM, JSOM and REST API indexes, please add a link description
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.