Understanding JavaScript Object -


this line @ top of javascript file in project @ school. can tell me does?

var tele = { 'forms': {}, 'form': {} }; 

it followed 3 functions contain more functions exampled below. formsview.js

tele.forms.view = new function (){     this.setrequesttitle = function (title) {     if (el.length == 0) {         settimeout(function () { tele.forms.view.setrequesttitle(title); }, 100);         return;     }     $('#formtitlebarsubmenutext').html(title);         document.title = title;     };     ....     .... }; 

then there second javascript file formview.js contains this

tele.form.view = new function () {     this.initialize = function (data) {         tele.forms.view.setrequesttitle('approval request');     }; }; 

i new javascript , scripting in general trying figure out how things work. understand happening inside functions, not tying together. thanks!

that line declares variable:

var tele; // declare variable identifier tele 

and assigns object literal it:

tele = {} // empty object literal 

the object literal has 2 properties, forms , form, value of each of object literal:

tele = { 'forms': {}, 'form': {} } // object literal 2 properties 

later on, these properties referred to, , further properties added values (their values object literals, can add properties them follows):

tele.form.view = new function () { // add view property tele.form     // ... }; 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -