hi6tsugu.com

ImportJS

インポート記述集約ライブラリー

ダウンロード

リファレンス

Import.js(filepath)

JS ファイルをインポート。

filepath: string
JS ファイルのパス。ドキュメントルートからの絶対パス、または本ライブラリーを配置したディレクトリーを基点とした相対パス

Import.css(filepath, media)

CSS ファイルをインポート。

filepath: string
CSS ファイルのパス。ドキュメントルートからの絶対パス、または本ライブラリーを配置したディレクトリーを基点とした相対パス
media?: string
CSS ファイルの内容を適用するメディア。省略した場合のデフォルト値は all

Import.path()

インポートの基点となるディレクトリーのパス (string) を取得。

Import.version()

バージョン (string) を取得。

使用例

HTML
<head>
  <script src="path/to/import-1.20131006.js"></script>
  <script src="path/to/main.js"></script>
</head>
main.js
Import.js('jquery-1.7.2.min.js');
Import.js('jquery.easing.1.3.js');
Import.js('action.js');
Import.css('../style/modal.css', 'screen');
Import.js('modal.js');

注意事項

更新履歴

v1.20131006