I'm trying to execute some JavaScript on page load on a custom page on a SharePoint site (it populates the people picker with the current user). The problem is that the code executes on postback too, which I don't want as it will reset any changes to the people picker.
I've tried using if(!IsPostBack)
to no avail. Everything errors out at that point, giving
SCRIPT5009: 'IsPostBack' is undefined.
I can't find anything online to help with this. Any ideas? Thanks
IsPostBack
is available in server side code, just clarifying, are you using that injavascript
? – Jamesyjavascript
, rather look out the answer posted., if that does not work, let me know, i will try to post answer. – Jamesy