With this Javascript:
function upsertPostTravelListItemTravelerInfo1() {
var clientContext = SP.ClientContext.get_current();
. . .
...I sometimes get this err (not always, as shown by the data from this method inserting into the list a couple of times (but not the other times)); the err msg, as displayed in the browser console (Chrome Dev Tools) is:
Uncaught TypeError: Cannot read property 'get_current' of undefined
Based on this, I tried this at the top of my Javascript in my *.ascx file:
ExecuteOrDelayUntilScriptLoaded(CustomAction, "sp.js");
...but that heaves up a hairball with the following manifestation of apparent crankiness inscribed upon it: "CustomAction not defined"
What the heck, Ramsey! I can't win for losin', as the old saying goes. How can I get get_current() to consistently execute correctly?
So, I tried this code instead:
function upsertPostTravelListItemTravelerInfo1() {
var clientContext = new SP.ClientContext(siteUrl);
. . .
...but got this err msg instead:
Uncaught Sys.ArgumentException: Sys.ArgumentException: Value does not fall within the expected range.
Parameter name: serverRelativeUrl
A slew of "gobbledygook" followed (a dump only a pure D geek could love), including the following two portions that look like they might have some connection: if(!SP.ScriptUtility.isUndefined(window._spPageContextInfo)&&!SP.ScriptUtility.isUndefined(window._spFormDigestRefreshInterval)&&!SP.ScriptUtility.isUndefined(window.UpdateFormDigest)){var c=window._spPageContextInfo,d=c.webServerRelativeUrl,e=window._spFormDigestRefreshInterval;
...and:
if(!a)throw Error.argumentNull("serverRelativeUrl");if(!a.startsWith("/"))throw Error.argument("serverRelativeUrl");
Can anybody make heads or tails of this?