Export (0) Print
Expand All

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

apps for Office

This article explains 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: May 01, 2015

Applies to: Access apps for SharePoint | apps for Office | Excel | Office Add-ins | Outlook | PowerPoint | Project | Word

Learn more about supported hosts and other requirements.

Note Note

The name "apps for Office" is changing to "Office Add-ins". During the transition, the documentation and the UI of some Office host applications and Visual Studio tools might still use the term "apps for Office".

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