Referencing the JavaScript API for Office library from its content delivery network (CDN)

apps for Office

Shows how to reference the JavaScript API for Office library (Office.js and associated application-specific .js files) from its content delivery network (CDN) location.

Last modified: January 19, 2015

Applies to: Access app for SharePoint | Excel 2013 | Excel 2013 RT | Excel 2013 SP1 | Excel Online | Outlook 2013 | Outlook 2013 RT | Outlook 2013 SP1 | Outlook for Mac for Office 365 | Outlook Web App | OWA for Devices | PowerPoint 2013 | PowerPoint 2013 RT | PowerPoint 2013 SP1 | PowerPoint Online | Project 2013 | Project 2013 SP1 | Word 2013 | Word 2013 RT | Word 2013 SP1

   Office.js: v1.0, v1.1

   Apps for Office manifests schema: v1.0, v1.1

The JavaScript API for Office library consists of the Office.js file and associated host application-specific .js files, such as Excel-15.js and Outlook-15.js. When developing an app for Office for any Office host application, you should reference the JavaScript API for Office library inside the <head> tag of the web page (such as an .html, .aspx, or .php file) that implements the UI of your app. To do that, add a script tag with its src attribute set to the following CDN URL:

<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>

The first time your app loads, the JavaScript API for Office library files will be downloaded and cached to make sure that your app is using the most up-to-date implementation of Office.js and application-specific .js files for the specified version.

The version number in the CDN URL indicates the major and minor version of the specified library. At the time of this writing, JavaScript API for Office (v1.1) is the most current release.

The default Home.html file in your project will contain the appropriate script tag that references the version 1.1 library if you develop your app with the App for Office project template files provided with:

If you develop your app the App for Office project template files provided with Visual Studio 2012 and Office Developer Tools for Visual Studio 2013 (download here), you must use download the updated NuGet package that contains the updated version 1.1 library files, and then update your project to reference them.

Show:
© 2015 Microsoft