Coder Social home page Coder Social logo

mapletao / lodjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yanhaijing/lodjs

0.0 2.0 0.0 50 KB

JavaScript模块加载器,基于AMD。迄今为止,对AMD理解最好的实现。

License: MIT License

JavaScript 94.90% HTML 0.33% CSS 4.77%

lodjs's Introduction

JavaScript模块加载器,基于AMD。迄今为止,对AMD理解最好的实现。

功能概述

100%支持AMD规范,支持模块化开发,当定义好模块后,便可使用模块,无需维护依赖的模块,仅需写好依赖就可以了,lodJS会负责依赖注入。

特性

  • 模块化开发支持
  • 异步加载
  • 依赖注入
  • 灵活的自定义功能

兼容性

  • Safari 6+ (Mac)
  • iOS 5+ Safari
  • Chrome 23+ (Windows, Mac, Android, iOS, Linux, Chrome OS)
  • Firefox 4+ (Windows, Mac, Android, Linux, Firefox OS)
  • Internet Explorer 6+ (Windows, Windows Phone)
  • Opera 10+ (Windows, linux, Android)

如何使用?

传统用法

<script src="lodjs.js"></script>

Bower

$ bower install lodjs
$ bower install git://github.com/yanhaijing/lodjs.git

快速上手

定义模块

使用lodJS的全局函数define定义一个模块,例如在 mod.js中有如下代码:

define(function () {
	return 123;
});

使用模块

使用lodJS的use方法使用一个模块,下面的代码可以使用上面定义的模块:

lodjs.use('mod', function (mod) {
	console.log(mod);//输出 123
});

更多例子,请见目录下的demo目录。

文档

API

贡献指南

如果你想为lodJS贡献代码,请采用fork + pull request 方式,并在发起pr前先将master上超前的代码rebase到自己的分支上。

发布Bower

$ bower register lodjs git://github.com/yanhaijing/lodjs.git

报告问题

作者

yanhaijing

更新日志

更新日志

相关链接

AMD规范

AMD实现

CMD

lodjs's People

Contributors

yanhaijing avatar

Watchers

James Cloos avatar zTao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.