In practice, it is a good idea to keep an information or Web site by remembering that the object's properties and methods are almost impossible tasks in the browser. But it also takes a lot of time to access the data, and if a script can print out the structure of the object, it will speed up the development process.
Here is an example of the View object structure I wrote, please download the attachment to get the executable code:
//animal is an object Animal = {Createnew:function (bundle) {var Animal = {}; var protect = Bundle | |
{};//bundle Pass is the pointer, modify protect when the outside object will be changed (unless not transmitted) Protect.sound = ' growl ';
Protect.makesound = function () {return protect.sound;
return animal;
}//cat is also an object cat = {pubvar: "Cat", Createnew:function (mysound) {
var protect = {};
var cat = animal.createnew (protect);//protect will be modified, then return blank object {} to Cat protect.sound = Mysound;
Cat.meow = function () {return protect.makesound ();};//cat to call method return Cat in protect;
//javascript is case-sensitive and constructs a new object assignment to cat var cat = cat.createnew ("meow!") by a Cat object;
var bigcat = cat.createnew ("meow!meow!meow!");
Showobject ("Cat");
Showobject ("Cat"); Showobject ("Bigcat");
Debugging information:
[Object] Cat
|--[function] CreateNew = function (mysound) {var protect = {}; var cat = animal.createnew (protect);//protect will be modified, then return blank Object {} to Cat protect.sound = Mysound; Cat.meow = function () {return protect.makesound ();};//cat to invoke method return cat in Protect;}
|--[string] Pubvar = Cat
[Object] Cat
|--[function] Meow = function () {return protect.makesound ();}
[Object] Bigcat
|--[function] Meow = function () {return protect.makesound ();}
[Note 1] is similar to traversing the DOM structure, for example, a blog post will be written to show the IE10 window object. Specifically, the implementation of Showobject ("window") in IE10;
[Note 2]object type has a drill-down link, but there is a small problem: it is not possible to rollback, it is recommended to press the F5 key.)
This article is from the "idata" blog, please be sure to keep this source http://idata.blog.51cto.com/4581576/1103408