Skip to main content

Posts

Showing posts from July, 2020

How to get Current web logged in User of a SharePoint site in jQuery?

Get Current web logged in User of a SharePoint site in jQuery: Use the below snippet and just replace the jquery library URL and run on you SharePoint page. <script src="../Assets/Jquery/jquery-1.9.1.min.js"></script> <script > function getCurrentLogInUser(){ $.ajax({     url: _spPageContextInfo.webServerRelativeUrl + "/_api/web/currentuser",     type: "GET",     async:false,     headers: { "Accept": "application/json;odata=verbose" } }).success(function( data ){     console.log( data );     console.log( data.d.Title ); }).error(function(e){     console.log( e ); }); } getCurrentLogInUser(); </script> Output: Raju Kumar. Yadav

Get Current Web User of SharePoint with JavaScript.

Get Current Web User of SharePoint with JavaScript: Use the below code to get current logged in User details of a SP Site: <script type="text/javascript" src="_layouts/15/ps.js"></script> <script type="text/javascript"> function getLoggedInUserData(){       //Get the Project context for this web       var projContext = PS.ProjectContext.get_current();       var user = projContext.get_web().get_currentUser();       projContext.load(user);       projContext.executeQueryAsync(function () {         console.log("Current Logged in User is " + user.get_title());         console.log("Id of Current Logged in User is " + user.get_id());         console.log("Login Name of Current Logged in User is " + user.get_loginName());         console.log("Email of Current Logged in User is " + user.get_email());       }, ...

How to read/retrieve more than 5,000 items from SharePoint using rest api?

Read/retrieve more than 5,000 items from SharePoint using rest api: var resultData = []; // variable (array) is used for storing list items var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Company')/items?$top=5000"; //SP list URL or REST API, In rest api Company is List name function fetchDataFromSPList(){     $.ajax({  // Ajax          url: url,           method: "GET",           headers: {               "Accept": "application/json; odata=verbose"           },         success: function(data){             resultData = resultData.concat(data.d.results);             if (data.d.__next != undefined) {                 url = data.d.__next;       ...

How to run first react app of react.js/single page application?

To run first react app: In this tutorial you will learn that how to create and run first app or first program in react.js. 1. First you need to install Node.js and  NPM in you system. To know how to install in windows Click here. 2. After installing, Open windows command prompt & type/enter command-  npx create-react-app my-react-app   and press Enter from you keyboard. After that Process of installing required files for react.js environment will be get started. It will take 6-8 minutes as it is creating first app name "my-react-app". After creating first app it will show message like "Succes! Created my-react-app at C:\Users\Raju\my-react-app ... Happy hacking!"; 3. Now go to directory "C:\Users\Raju\my-react-app". To go to directory enter command- cd my-react-app  or cd C:\Users\Raju\my-react-app  and press enter Again enter command- npm start  and press enter. Wait a minute, It will automatically open the app in d...

How to Download & Install Node.js and npm on Windows ?

How to install Node.js & npm on Windows In the first steps in using Node.js is the installation of the Node.js libraries on the client system. Now a day npm is coming with Node.js file. To perform the installation of Node.js, follow the below steps; Step 1) Go to the site https://nodejs.org/en/download/ and download window installer file for node.js. In our example, we are going to download the 64-bit setup files for Node.js.. Step 2)  Right click on the downloaded .msi file to start the installation. Click the Install option on the first screen to begin the installation. Step 3)  In the next screen, click the "Next" button to continue with the installation Step 4)  Now tick/click on "checkbox I accept the terms in the License Agreement" and then click on "Next" button Step 5)  It will automatically select the path or you can optionally choose path by using "Change " button. Here we are going to Just Click...