I have a custom html and javascript file housed within a document library of a subsite:
http://teamsite/project/testing%20site/shared%20documents/test.html
and
http://teamsite/project/testing%20site/shared%20documents/test.js
function testContext(){
var clientContext = new SP.ClientContext("http://teamsite/projects/testing%20site/");
var oWebsite = clientContext.get_web();
this.collList = oWebsite.get_lists();
clientContext.load(collList);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onWin), Function.createDelegate(this, this.onFail));
function onWin(){alert("Success");}
function onFail(){ alert("Fail");}
Everytime I execute the above I get this error:
SCRIPT5022: Sys.ArgumentException: Value does not fall within the expected range. Parameter name: serverRelativeUrl sp.runtime.js, line 2 character 38258
I've tried several different methods to get CSOM to work in this instance and everytime I get the same error.