require
by
noromanba
2014-09-02 [2014/09/02 03:47:54]
(Forked from
$X by
taizooo)
require js-modules for over the mixed-content-blocking
@@ -13,12 +13,12 @@
// HTMLやCSSでのプロトコル表記(http:、https:)の省略について: 小粋空間 http://www.koikikukan.com/archives/2012/05/11-012345.php
// Uniform Resource Identifier (URI): 一般的構文 | 4.2. 相対的参照 http://www.studyinghttp.net/cgi-bin/rfc.cgi?3986#Sec4.2
-(function (urls) {
- urls.forEach(function (u) {
- var scr = document.createElement("script");
- scr.src = u;
- document.body.appendChild(scr);
- })
-})([
- "//example.com/example.js"
-])
+var require = function (urls) {
+ urls.forEach(function (u) {
+ var scr = document.createElement("script");
+ scr.src = u;
+ document.body.appendChild(scr);
+ });
+};
+
+//require(["//example.com/example.js"]);
var require = function (urls) {
urls.forEach(function (u) {
var scr = document.createElement("script");
scr.src = u;
document.body.appendChild(scr);
});
};
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。