同类中方法之间相互调用
aa.html:<html><head>
<SCRIPT LANGUAGE="JavaScript" src="Diet.js"></SCRIPT>
</head><body>
<script language="javascript">
var aa = new Diet();
aa.bound();
</script>
</body></html>
Diet.js:
function Diet(){
this.bound = function(){
document.write('<a href="#" onclick="this.tiles()">addd</a>');
}
this.tiles = function(){
alert("aa");
}
}
上面onclick="this.tiles()"这样调用不行。javascript同类的方法之间如何调用呀?