_spBodyOnLoadFunctionNames: Generally, ASP.NET 2.0 Master page concept is used for sharepoint pages and the “body ” is defined in master page. So, the content page is not able to add function to the body’s onload event directly. In order to work around this limitation, SharePoint provides the “_spBodyOnLoadFunctionNames” array. When the body is loaded, the onload event handler executes each function whose name is contained in this array. We added “myFunction” to the array so that it would run when the body’s onload event fires.
1. Make sure in the head tag, init.js is included.
2. Body onload is properly defined.
Hope, It helps.