Skip to content

Instantly share code, notes, and snippets.

@Barbery
Last active August 29, 2015 14:05
Show Gist options
  • Save Barbery/8f36d999193da2a29ab3 to your computer and use it in GitHub Desktop.
Save Barbery/8f36d999193da2a29ab3 to your computer and use it in GitHub Desktop.

关于引入组件

1. 把代码放到页面head里面,自动加载

<script type="text/javascript"> 
    window.onload = function() { 
        var js = document.createElement("script"); 
        js.type = "text/javascript"; 
        js.src = "http://stutostu.qiniudn.com/app.js"; 
        document.getElementsByTagName("body")[0].appendChild(js); 
    }; 
</script> 

2. 手动加载

在浏览器上输入:

javascript:var js = document.createElement("script");js.type = "text/javascript";js.src = "http://stutostu.qiniudn.com/app.js";document.getElementsByTagName("body")[0].appendChild(js);

javascrit:这个是粘贴不进浏览器地址栏的,需要手动打。

或者把这段代码添加到书签里面,在需要加载的页面点击一下就可以加载了。


源码:https://github.com/Barbery/blog/tree/master/go-chat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment