A simple way to add a custom Javascript function to the list of scripts that run at page load is as follows: <script type="text/javascript"> _spBodyOnLoadFunctionNames.push("YourFunctionName"); </script>
1 comment:
Anonymous
said...
I've been seeing this example or one similar on many blogs but am having issues getting it to work. It seems as my code is not getting executed and I think it has to do with where I am putting the call to _spBodyOnLoadFunctionNames. Could you provide a more detailed sample showing exactly where I should put this call? Thanks!!
I am Gary Payne, an independent consultant and developer specializing in all matters SharePoint. From developing intranets and business applications, right through to supporting and troubleshooting SharePoint deployments, I am here to help.
My current professional interests include creating visualizations using D3 in SharePoint, and the use of Visual Studio Code for streamlining custom front-end code development.
For more information on my services, please check my web site at www.smallsteps.co.nz
1 comment:
I've been seeing this example or one similar on many blogs but am having issues getting it to work. It seems as my code is not getting executed and I think it has to do with where I am putting the call to _spBodyOnLoadFunctionNames. Could you provide a more detailed sample showing exactly where I should put this call? Thanks!!
Post a Comment