Page 1 of 1

Javascript Questions

Posted: Sun Jan 22, 2006 7:52 pm
by mudvein
I'm working with Javascript and have a small question about what I'm looking at.

In many examples I am seeing code that looks like this :

Code: Select all

var.SomeNameHere = function(param1, param2, param3) {
 //some stuff done here
}
What is the point of doing this?


Also, I see a variable being defined like this :

Code: Select all

var.SomeNameHere.extension = {
  loadData: function {
    //if statements and other stuff done
  }
}
And what is the piotn of doing this as well?


If anyone can post me a few links that would explain this I would be very grateful. I have searched google for "Create function" but none of the tutorials show this. Only example code seems to have this in it. Thanks

Posted: Sun Jan 22, 2006 8:16 pm
by mudvein