Skip to main content

Posts

Showing posts from November, 2014

Upload files and sub folder to SharePoint library from local folder using PowerShell

#Task performed in this PowerShell script.
#=============================================================
#Replicate Local folder with subfolder and files in SharePoint document library
#=============================================================
#Prerequisite
#Document Library for uploading files should be alresdy created
#=============================================================
#Author : Satish R Gadekar
#Date   : 11/13/2014
#=============================================================


Get current site web URL in JavaScript or JQuery

Use JavaScript variable name "L_Menu_BaseUrl" to get current web url and map it to any code in JavaScript.  This variable will be initialized on SharePoint pages by default. Below script will be always there when you do view source of the page:

<script type="text/javascript">
var L_Menu_BaseUrl="/ESearchCenter";
var L_Menu_LCID="1033";
var L_Menu_SiteTheme="";
</script>


OR 

You can make use of  below variables

1. var webUrl = _spPageContextInfo.webServerRelativeUrl;
2. var siteUrl = _spPageContextInfo.siteServerRelativeUrl;