With the rise of AJAX and Google Api’s javascript is hot again, with the new scriptmanager of ASP.NET it is very easy to integrate javascript with server side code.
Today I encountered a Static Function in javascript, my collegues and i were unsure how to use this. It is pretty easy once you know it. The code is as below:
/**
* Static class for handling test creation.
* @class
*/
function testClass()
* Static class for handling test creation.
* @class
*/
function testClass()
{
}
}
/*Static function*/
testClass.getInfo= function (){
testClass.getInfo= function (){
return 1;
}
You can call it in code:
var value = testClass.getInfo();