Timeline for SP 2010 CSOM Javascript: serverRelativeUrl fails
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 26, 2014 at 15:12 | vote | accept | Patrick Burke | ||
Sep 26, 2014 at 14:48 | comment | added | Patrick Burke | So assuming the HTML and Javascript are executing out of site/sitename/shareddocuments and the list I want to access is in site/sitename I have attempted absolute URL reference 'site/sitename' (fails) and the relative URLs '../' and 'site/sitename' and '../.' and all fail. | |
Sep 26, 2014 at 14:43 | comment | added | Patrick Burke | This doesn't appear to work because the javascript lives outside of webparts. Code: var ctx = SP.ClientContext.get_current(); var oWebsite = ctx.get_web(); this.collList = oWebsite.get_lists(); clientContext.load(collList); clientContext.executeQueryAsync(Function.createDelegate(this, this.onWin), Function.createDelegate(this, this.onFail)); Throws 2x errors: SCRIPT5007: Unable to get value of the property 'webServerRelativeUrl': object is null or undefined SCRIPT5022: Sys.ArgumentException: Value does not fall within the expected range. Parameter name: serverRelativeUrl | |
Sep 26, 2014 at 13:03 | history | answered | Vadim Gremyachev | CC BY-SA 3.0 |