I am trying to get some information about the current context through the sharepoint javascript object model and am getting annoying errors.
$(document).ready(function () { ExecuteOrDelayUntilScriptLoaded(loadConstants, "sp.js"); });
function loadConstants() {
var ctx = new SP.ClientContext.get_current();
var site = ctx.get_site();
IPC_siteUrl = site.get_url();
IPC_siteId = site.get_id();
var web = ctx.get_web();
}
This is what im calling in a javascript file in our core javascript file, and when i try to call "ctx.get_site()" I am getting errors through the dev console on ie8.
The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
Im not sure why this is happening as im following Microsofts directions.
Any thoughts?