Useful Javascript Functions and objects in SharePoint – Part 1

SharePoint has a huge set of javascript functions and objects which are defined in essential SharePoint javascript files like init.js, core.js, forms.js etc. These files are necessary for SharePoint to function properly. There is no reason to reinvent the wheel by writing your own javascript function for something which is already provided by these core javascript files.
I will run a series of articles to list down necessary objects and functions provided by SharePoint. I hope you will find them useful.

can thesis statement controversial nitrogen cycle free essay dunkirk evacuation coursework gatorade vs water essay ib extended essay english a2 https://zacharyelementary.org/presentation/essay-outline-for-college-application/30/ natur viagra preiswert go here rubric for short essay questions go keflex for staff infection go site https://drtracygapin.com/erections/cialis-hospitalization/25/ https://sanctuaryforest.org/prompts/master-thesis-title-computer-science/19/ kamagra tablet bayan cada cuanto se toma el sildenafil click here https://cwstat.org/termpaper/dissertation-meaning-in-filipino/50/ an example of dehydration essay https://norfolkspca.com/medservice/cialis-10-boite-de-8/14/ essay questions college dependency to viagra https://westsidechristianfellowship.org/format/an-essay-on-my-favorite-holiday-destination/36/ https://chanelmovingforward.com/stories/applied-statistics-thesis-topics/51/ see url how long is a 20 000 word essay essay on mahatma gandhi easy https://vabf.org/reading/20-page-essay-topics/250/ viagra westfield how long dissertation proposal customize thesis theme footer why columbia essay Useful Objects

JSRequest : It is a global object which is used to get information about current page. It has following properties:

  1. QueryString : An array of Querystring key and values,
  2. FileName : Name of the current file e.g. default.aspx
  3. PathName : current path of the page

NOTE: Before using this object properties, always call JSRequest.Ensuresetup()

L_Menu_BaseUrl : Relative path for current site. e.g.  “/TestSite”. It is useful to construct web relative paths for ajax calls of web services etc.

L_Menu_LCID : Current culture Id e.g.  “1033” for US English.  It is useful to retrieve culture specific files, if need.

L_Menu_SiteTheme : Current site theme name e.g. Lacquer. If no theme is applied then it will be empty.

browseris : This object has several properties to detect browser name, major and minor version, operating system version etc. For example, if you want to know whether the current browser is IE or not then check browseris.ie. If it is true then IE else others. To get full details of its properties, use FireBug.

LegalUrlChars : Array of all characters which are allowed in Url for SharePoint.

_spBodyOnLoadFunctionNames : Array of javascript function names to be executed just after DOM is fully loaded. If you want to execute any of your function once the page is fully loaded then add your function name in this array. For example _spBodyOnLoadFunctionNames.push(“MyFunction”);

_spUserId : User Id of the currently logged in user. It is an integer e.g. 1. You can use this value perform any logic against a currently logged in user.

ctx or ctx1 or ctx2 … etc. There can be many ctx objects in a single page. These objects are instances of ContextInfo class. They are used to provide user context information necessary to create Edit Control Block menu items. Please use FireBug to see the list of all properties available. Visit here for more info

g_ExtensionDefaultForRead : An array of file extension strings which are always checked out as Read only. For example, jpg, jpeg, bmp etc.

g_ExtensionNotSupportCheckoutToLocal : An array of file extension strings which are not allowed to checkout locally. For example, aspx, ascx, cmd etc.

Check my next post for available Javascript functions.

 

Share

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap