I have researched this pretty thoroughly and everyone says that the code I have below should load SP.js, but I cannot get it to load.
Debugging I get:
NewForm.aspx, line 1667 character 5
SCRIPT5009: 'PeoplePicker' is undefined
and do not see SP.JS under view sources.
<SharePoint:ScriptLink Name="SP.js" runat="server" OnDemand="true"
Localizable="false" />
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(SetWebUserData(), "SP.js");
function SetWebUserData() {
var pplPicker = new PeoplePicker();
// Set the parent tag id of the people the picker.
pplPicker.SetParentTagId('Main_x0020_Contact');
pplPicker.SetLoggedInUser();
};
</script>
Any assistance greatly appreciated.
I was able to resolve the issue and have people picker populated with the current user by using code found here: http://vbcity.com/blogs/skullcrusher/archive/2008/11/04/set-sharepoint-peoplepicker-field-mark-2.aspx
This code does not require SP.js
I was never able to get sp.js to load properly, but this solution fixes my problem.