$(document).ready(function()
{
IncomeDetails.initIncomeForm();
});
The above code is written in XSL File.
Can anybody explain me what does this Javascript code means ?
Is IncomeDetail is class ? what is it scope ? what is its use?
I find in my code this code is definded app.js file as
IncomeDetails = {
initIncomeForm : function()
{...some code here
what does it means?
IncomeDetailsis an object andinitIncomeFormis a method therein.This syntax
is how you declare an object literal in JavaScript, though the author may have been a bit sloppy. Assuming IncomeDetails is not previously declared elsewhere, leaving off the
varhere will cause this object to an implicit global variable, and therefore, to answer your other question, global in scope.