Thursday, January 23, 2014

Trigger Javascript Function on SharePoint Page Load

Want to trigger a Javascript function on SharePoint page load? All you have to do is push your function's name to this array and it will trigger in the OnLoad event of the window. 

Example: Place this code in CEWP
_spBodyOnLoadFunctionNames.push("MyFunction");
function MyFunction() {
    alert('it works');
}


In custom SharePoint pages, this chunk needs to be added just below: PlaceHolderMain or PlaceHolderAdditionalPageHead

Reference:

http://www.sharepointdiary.com/2010/01/want-to-trigger-javascript-function-on.html


No comments:

Post a Comment

Image noise comparison methods

 1. using reference image technique     - peak_signal_noise_ratio (PSNR)     - SSI 2. non-reference image technique     - BRISQUE python pac...