Giter Site home page Giter Site logo

yanhaijing / lodjs Goto Github PK

View Code? Open in Web Editor NEW
289.0 33.0 51.0 58 KB

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

License: MIT License

JavaScript 94.90% CSS 4.77% HTML 0.33%
amd amd-specifications loader dependency-injection

lodjs's Introduction

Chinese README

The JavaScript module loader is based on [AMD] (https://github.com/amdjs/amdjs-api/blob/master/AMD.md). lodJS is the best implemented understanding of [AMD] (https://github.com/amdjs/amdjs-api/blob/master/AMD.md) up to now.

Function Overview

100% supports AMD specifications. Supports modular development. When a module is defined, modules can be used without maintaining a dependent module, just write a dependency, and lodJS will automatically be responsible for the dependency injection.

Characteristics

  • Modular Development Support
  • Asynchronous loading
  • Dependency injection
  • Flexible custom functionality

Compatibility

  • 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)

How to Use?

Traditional Usage

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

Bower

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

Quick Start

Define Module

We use lodJS's global function define to define a module, for example, in mod.js, we have the following code:

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

Module Usage

The use method in lodJS uses a module. The following code can use the module defined above:

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

For more examples, please see the directory of demo.

Document

API

Contribution Guide

If you want to contribute code for lodJS, please use fork + pull request method, ensuring that before you launch pr, you rebase code on the master branch to your own branch.

Publish Bower

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

Report Issues

Author

yanhaijing

Update Log

Update Log

Related Links

AMD Specifications

AMD Implementation

CMD

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.