Archive

Archive for April, 2009

Adding JavaScript function to SharePoint application pages

April 22, 2009 4 comments

Hi there, just a quick and simple posting today. At some point you may need to call some custom java script when your page loads in SharePoint. To have your custom function called during the onLoad event simply add the _spBodyOnLoadFunctionNames.push method. to your script block

 

Sample script block added to your application page in SharePoint…

<script type="text/javascript">

_spBodyOnLoadFunctionNames.push(

"someFunction");

function someFunction() {

    alert(

"Hello world!)";

}

</script>

Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.