var Function1=function2;
1. The result of calling the Function1 () function is exactly the same as calling Function2 () because two functions refer to the same code, so the function name is also called a function call.
2. The difference between the reference function and the calling function is related to whether the function name is enclosed in parentheses, and the function reference will only appear separately, but the function call must be followed by parentheses, often with an argument attached.
3.window.onload=function () {
Function1 ();
}
At this point function1 () is the callback function, and all other events on the webpage can be joined in the OnLoad event handler. The OnLoad event handler becomes an event initialization function that sets up other events in the Web page, so the OnLoad event not only performs general Web page startup tasks, such as initialization, it also joins other event handler callback functions to the application.
Such as:
//go to page default displayWindow.onload=function() {boundarydesign.clearroom (Context,obj,scale); Tiledesign.clearfloor (Ctx,obj,scale); Zone.initroomdata (Obj,minx,miny); //Default Display Menu$ (". Select"). Children (). EQ (0). Trigger ("click"); $(". Select"). Children (). Click (function() { if($ (". Select"). Children (). EQ (1). Hasclass (". Active") && $ (". Mode_list"). Children (). EQ (3). Hasclass (". Active ")) { $(". Default-static"). attr ("Disabled", "disabled"); } }); //Disable right mouse button default menu$ (document). Bind ("ContextMenu",function(e) {return false; }) });
JS function Reference, function call and callback function