Run Javascript code when SharePoint page/form loaded

There is internal SharePoint JavaScript Array when loading page/form.

So if you add just simple code without jquery, utilize this.

don’t need to use below jquery reday and don’t need to include jquery.js location.
$(document).ready(function () {
//Add code here
});

_spBodyOnLoadFunctionNames.push(“MyOwnFunctionName”);

function MyOwnFunctionName()
{
// Add code here
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: