Created
May 17, 2014 00:35
-
-
Save ifnull/e5863ed1a50bbf3d29ed to your computer and use it in GitHub Desktop.
PrismJS Bookmarklet Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a href='javascript: (function(){var e="https://your.website.com/prismjs/";var t=document.createElement("script");var n=document.createElement("link");t.setAttribute("src",e+"prism.js");n.setAttribute("href",e+"prism.css");n.setAttribute("rel","stylesheet");document.body.appendChild(n);document.body.appendChild(t);t.onload=function(){Prism.highlightAll()}})()'>Bookmarklet</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var prismbase = 'https://your.website.com/prismjs/'; | |
| var prismjs = document.createElement('script'); | |
| var prismcss = document.createElement('link'); | |
| prismjs.setAttribute('src', prismbase + 'prism.js'); | |
| prismcss.setAttribute('href', prismbase + 'prism.css'); | |
| prismcss.setAttribute('rel', 'stylesheet'); | |
| document.body.appendChild(prismcss); | |
| document.body.appendChild(prismjs); | |
| prismjs.onload = function() { | |
| Prism.highlightAll(); | |
| }; | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment