Skip to content

Instantly share code, notes, and snippets.

@IskenHuang
Created December 27, 2013 05:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IskenHuang/8142982 to your computer and use it in GitHub Desktop.
Save IskenHuang/8142982 to your computer and use it in GitHub Desktop.
inject script to html
javascript:!function(d,script){script=d.createElement("script"),script.type="text/javascript",script.async=!0,script.onload=function(){return TogetherJS(this),!1},script.src="https://togetherjs.com/togetherjs-min.js",d.getElementsByTagName("head")[0].appendChild(script)}(document);
(function(d, script, button) {
script = d.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.onload = function(){
// remote script has loaded
button = d.createElement('button');
button.addEventListener( 'click', function(){
TogetherJS(this); return false;
}, false);
d.getElementsByTagName('body')[0].appendChild(button);
button.innerHTML += 'TogetherJS';
};
script.src = 'https://togetherjs.com/togetherjs-min.js';
d.getElementsByTagName('head')[0].appendChild(script);
}(document));
(function(d, script) {
script = d.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.onload = function(){
// remote script has loaded
TogetherJS(this); return false;
};
script.src = 'https://togetherjs.com/togetherjs-min.js';
d.getElementsByTagName('head')[0].appendChild(script);
}(document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment