代码如下:
document.onload = (function() {
var GraphCreator = function(name) {
var thisGraph = this;
console.log(thisGraph);
this.name = name || '';
};
GraphCreator.prototype.setName = function(name) {
var thisGraph = this;
thisGraph.name = name;
};
GraphCreator.prototype.addTab = function(data) {
var content = document.getElementById('content');
var tab = juicer($('#extended_tpl').html(), data);
content.append(tab);
};
window.GraphCreator = GraphCreator;
})();
var graph = new GraphCreator();
graph.setName('graph_one');
这样写会引起内存泄漏吗?哪些地方是不合理的?
RISEBY
当年话下
相关分类