Skip to content

Instantly share code, notes, and snippets.

View Inkdpixels's full-sized avatar

Tyll Weiß Inkdpixels

View GitHub Profile
@Inkdpixels
Inkdpixels / gist:8f37f8687d2b24e98950
Last active August 29, 2015 14:08
webfontjson-localStorage.js
<script type="text/javascript">
/**
* Load and cache the css string from webfontjson(https://github.com/ahume/webfontjson) in the UA's localStorage.
* @author Tyll Weiß(https://github.com/Inkdpixels)
* @param url {string} The URL where the JSONP is located.
* @param jsonpCallbackName {string} The name of the function which will be called by the JSONP.
* @param useDefaultCallback {boolean} Use the default callback provided by this script?
* @param timestamp {string} The timestamp, to clear the users cache - change this string.
*/
var loadCachedWebFonts = function(url, timestamp, jsonpCallbackName, useDefaultCallback) {