#眉標=AJAX
#副標=Javascirpt類別的特性
#大標=建構仿OO式的物件導向程式
#作者=文/圖	柯伯旻


==<灰>===========
function a1_func(){ a2_func(1,2);alert(“final a1_func.caller=”+ a1_func.caller);}
function a2_func(){alert(“arguments[0]=”+ arguments[0]);
alert(“arguments[0]=”+ arguments[1]);
alert(“arguments.callee=”+ arguments.callee);
alert(“a2_func.caller=”+ a2_func.caller);}
==<end>==============



==<灰>===========
function a1_class(){this.property1=”this is a1. property1”;
this.property2=” this is a1. property2”;}
==<end>==============




==<灰>===========
function a1_class( )
{
	var private1=”this is private1 of a1”;
	this.get_ private1=function( ){return private1;}
	this.set_private1=function(new_value ){ private1= new_value;}
}
==<end>==============




==<灰>===========
function get_ private1( ){ return private1;}
==<end>==============




==<灰>===========
var a1_first_object = new a1_class( );//初始化一個a1_class的實體
a1_first_object.get_ private1( );
==<end>==============




==<box>===========
程式1
function a1_class( )
{
	var private1=”this is private1 of a1”;
	this.get_ private1=function( ){return private1;}
	this.set_private1=function(new_value ){ private1= new_value;}
	this.public1=”this is public1 of a1”;
	this.inner_get_ public1=function{ return this.public1;}
}
a1_class.prototype.get_public1= function( ){return public1;}
Function main( )
{
	var a1_object=new a1_class( );
	alert(“a1_object.public1=”+ a1_object.public1);
	alert(“a1_object. get_public1( )= ”+ a1_object. get_public1( ));
}
==<end>==============



==<灰>===========
func_point_exe(a1_obj1.get_public1)
==<end>==============



==<灰>===========
func_point_exe(func_point )
{
	this.public1="this is public1 of func_point_exe";
  alert(func_point.call(a1_obj1));
}
==<end>==============



==<灰>===========
// var a1_obj1=new a1_class( );
function InvokingEntry()
{
var a1_obj1=new a1_class( );
    alert(a1_obj1.get_public1());
    func_point_exe(a1_obj1.get_public1, a1_obj1);
}
function func_point_exe( event_handler, event_subscriber)
{
	this.public1=”………………………”
	alert(event_handler.call(event_subscriber));
}
==<end>==============



==<灰>===========
    a1_class.prototype.get_public1=function( p1, p2)
    {
        //alert(a1_class.prototype.get_public1.caller);
        return this.public1+”, p1=”+p1+”, p2=”+p2;
    }
==<end>==============




==<灰>===========
var paras= new Array(“this is p1”,”this is p2”);
alert(event_handler.apply(event_subscriber, paras));
==<end>==============




==<灰>===========
this.get_public1=function{ return _selfptr.public1;}
==<end>==============