For details, please click: http://www.verydemo.com/demo_c113_i6103.html
Ext.onReady(function() { alert("Ext JS and page load complete!"); });
var fn = function () { alert("This user's name is: " + this.name); } var user = { name : "Sun Wukong" } Ext.onReady(fn , user);
A function for specifying delayed execution
var fn = function (msg) { alert("This user's name is: " + this.name + "," + msg); } var user = { name : "Sun Wukong" } // Execute the fn function after a delay of 3 seconds Ext.defer(fn , 3000 ,user , ["Welcome"]);
Ext.apply() will overwrite the properties in the target object, while the Ext.applyIf() method only copies properties that are not in the target object but not in the source object and will not overwrite properties
var user = { name : "Sun Wukong", age : 500, gender: "男" } var cat = { name : "Garfield", color : "橙色" } // Specifies to copy the properties of the cat object to the user object. Ext.apply(cat , user); for(var propName in cat) { document.writeln(propName + "-->" + cat[propName] + "<br/>") ; }
var user = { name : "Sun Wukong", age : 500, gender: "男" } var cat = { name : "Garfield", color : "橙色" } var dog = { name : "Prosperity", weight: 32.1 } // Specify the ………………………………………………………………………………