If you have scenario where you want to call javascript function on the page load event in sharepoint, you can use " _spBodyOnLoadFunctionNames" method. Add the following line of code in the page/control design.
_spBodyOnLoadFunctionNames.push('FunctionName');
function FunctionName()
{
alter('Test');
}
_spBodyOnLoadFunctionNames.push('FunctionName');
function FunctionName()
{
alter('Test');
}
Hi, can we call two javascript function using this method ?At present I am not able to, if yes then please suggest the right way to do so.
ReplyDeleteCheers,
Amiya
Hi Amiya, to accomplish this, you can create a javascript function say "ExecuteMultipleFunctions" and call multiple functions inside this function. Then you can easily suffice your requirement of calling multiple function on page load by calling this single function on "_spBodyOnLoadFunctionNames"
Delete