Gadgets.cache (v0.8)

From VZ Developer Wiki

Jump to: navigation, search

General Guidelines | XML Specification | Features | Views | JavaScript API | REST API | Tutorials | OAuth


Contents

gadgets.cache

Get cached content from our CDN

Methods

gadgets.cache.getCachedUrl

gadgets.cache.getCachedUrl(path)
Returns the cdn url for a specific file uploaded in the deploy process
Parameters
String path - filename + extension
Returns
String - Url pointing to the cdn

gadgets.cache.getCachedPath

gadgets.cache.getCachedPath()
Returns the cdn path where files are uploaded in the deploy process
Returns
String - Url pointing to the cdn

gadgets.cache.getCachedJs

gadgets.cache.getCachedJs(pathArray, cb)
Injects javascript files dynamically into the head section of the page
Parameters
Array pathArray - array containing filename + extension
String cb - name of the callback function that should be executed after loading. You can also use a function within a namespace e.g. ‘my.space.somefunction’.
Returns
None

gadgets.cache.getCachedCss

gadgets.cache.getCachedCss(pathArray)
Injects css files dynamically into the head section of the page
Parameters
Array pathArray - array containing filename + extension
Returns
None


Examples

img.src = gadgets.cache.getCachedUrl('some.jpg');
gadgets.cache.getCachedJs(['js/jquery.js','js/app.js'], 'myfunction');
gadgets.cache.getCachedCs(['css/one.css','css/two.css']);


Help.png

This tutorial will give you more examples or information on these features:
Lesson 05: Fetching content from VZ CDN



VZspecific APIs

gadgets.cache

gadgets.tracking

vz.advertising

vz.invite

vz.embed

vz.flash

vz.vcard

Personal tools