How to check which SharePoint version is running?

Hi,

If you have upgraded SharePoint 2010 into SharePoint 2013, Some of SP.js code won't work for SharePoint 2013. But you want to check & run code as per version then you have to use this code :

if (SP.OfficeVersion.majorVersion == "14") {
    // SP2010 code here...
  } else {
    // SP2013 code here...
  }

Comments

Popular Posts

SharePoint Interview Questions and Answers

Download Infopath Form Templates

How to get current logged user information using JavaScript ?

Steps to set Form based authentication (FBA) for SharePoint 2010

SharePoint Interview Questions and Answers II

Get List Items - JavaScript

Change Language for current user with JSOM in SharePoint Online

Cross Site List Rollup Web Part for SharePoint 2010

Hide Recently Modified Items

SharePoint 2010 CSS Chart