<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body></body>
<script>
(function(){
var boss = "the boss";//全局变量
var config = {
onlad:function(obj){
name = obj.name || "jack";
console.log(name);
console.log(boss);
config.test();
},
test: function(){
console.log("test");
}
};
//公布函数
window.zz={test:config.onlad}
})();
//调用封装
zz.test({
name:"zhangsan"
});
</script>
</html>