a resource loader for javascript
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
test
README
relyJS.js

README

##API https://github.com/neekey/relyJS/wiki

##reqJS UPDATE
添加了和nodejs同样的方式来导入模块

1. 导入模块

	var module = $r.require('moduleName')

2. 模块写法

	var hello = function(){
		console.log('hello!');
	};
	exports.hello = hello;

3. 只能在以 $r.load 方法载入的js文件中使用 $r.require 方法

4. 之前嵌套模块导入

5. 包管理在研发中= =

6. 具体见test文件夹中的简单demo
  

##Description
relyJS is used to load resources, and provides a simple way to import other script files within script file!

This project is developed to solve the problem I encountered in my html5 game-project, which is i have to finished loading all the resource the game need.

This project can be used to load the script files, plain data files (html, css, json), images, etc.

##Simple example:
	$r.load( { 
		url: ['a.js', 'http://neekey.net/bg.png', '../html/b.html' ], 
		callback: function( module, userData ){}
	});

alse we can import other resource like we do in JAVA or C++, simple like this:

in a.js file :
	$r._rely(['b.js', '../c.js']);
	/* main code in a.js */