prototype--(補足する必要がある)
952 ワード
<html>
<body>
<script type="text/javascript">
function employee(name,job,born)
{
this.name=name;
this.job=job;
this.born=born;
}
var bill=new employee("Bill Gates","Engineer",1985);
employee.prototype.salary=null;
bill.salary=20000;
document.write(bill.job,bill.salary);
</script>
</body>
</html>
MapManager.prototype.BindLayerClick = function(layer,func){
if(!layer){
console.log("Bind layer is null");
return;
}
dojo.connect(layer,"onClick",function(evt){
if(func && func instanceof Function){
func(evt.graphic.attributes);
}
});
};
mapManager.BindLayerClick(layerControl.getLayer("interchange"),interchangeOnClick;