Last active
December 18, 2015 21:59
-
-
Save zhuochun/5851439 to your computer and use it in GitHub Desktop.
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 loadCss(css) { | |
| var link; | |
| if ($.isArray(css)) { | |
| $.each(css, function (idx, lk) { | |
| loadCss(lk); | |
| }); | |
| } else { | |
| link = document.createElement("link"); | |
| link.type = "text/css"; | |
| link.rel = "stylesheet"; | |
| link.href = css; | |
| document.getElementsByTagName("head")[0].appendChild(link); | |
| } | |
| }; |
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 loadFile(url) { | |
| var script = document.createElement('script'); | |
| script.src = url; | |
| document.getElementsByTagName('head')[0].appendChild(script); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment