Skip to content

Instantly share code, notes, and snippets.

@xdumaine
Created October 15, 2013 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdumaine/6993254 to your computer and use it in GitHub Desktop.
Save xdumaine/6993254 to your computer and use it in GitHub Desktop.
Inject apple touch icons with javascript
function injectAppleTouchIcons() {
var link = $(document.createElement('link'));
link.setAttribute('rel', 'apple-touch-icon');
link.setAttribute('href', '/themes/mobile/images/touch/apple-touch-icon.png');
$$('head')[0].insert(link);
link = $(document.createElement('link'));
link.setAttribute('rel', 'apple-touch-icon');
link.setAttribute('href', '/themes/mobile/images/touch/apple-touch-icon-72x72-precomposed.png');
link.setAttribute('sizes', '72x72');
$$('head')[0].insert(link);
link = $(document.createElement('link'));
link.setAttribute('rel', 'apple-touch-icon');
link.setAttribute('href', '/themes/mobile/images/touch/apple-touch-icon-114x114-precomposed.png');
link.setAttribute('sizes', '114x114');
$$('head')[0].insert(link);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment