目前是这样的:
html:
<script>
var aaa = new DDD();
aaa.initUI();
</script>
js:
var DDD = function(){
this.version = "v1.0";
DDD.prototype.initUI = function(){
console.log("init UI success");
}
}
但我想要的效果是:
html:
<script>
var aaa = new DDD.initUI();
</script>
就像是three.js创建scene的写法:
var scene = new THREE.Scene();
在js文件中如何写,才能在页面中通过这种方式(即new一个DDD不带括号)来调用DDD中的函数?