require(['jquery', 'underscore', 'backbone'], function ($, _, Backbone){
// some code here
});
js文件下a.js
define(function(){
function fun1(){
alert("it works");
}
fun1();
})
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="require.js"></script>
</head>
<body>
<script type="text/javascript">
require(["js/a"]);
</script>
</body>
</html>
德玛西亚99
相关分类