I'm using an asset lister to make a json object from the assetids of the standard pages under a nominated root node. The result page of the asset lister returns the correct values:
[quote]
Put some error handling stuff in and getting this back, but not sure what is causing the "unexpected token":
[/quote]
Unexpected token means the json object is broken. In the sample you posted your nested objects don't contain a property. I would look at changing the format of your JSON, eg:
[quote]
Unexpected token means the json object is broken. In the sample you posted your nested objects don't contain a property. I would look at changing the format of your JSON, eg:
[quote]
Yeah, you need to apply a special Design asset to the listing. Basically a blank design with a json content type.
[/quote]
Thanks Nick
I ended up nesting the asset listing inside a script tag and getting the object from the DOM. But I'll use your suggestion and try the xhr method again - much less complicated.
I ended up nesting the asset listing inside a script tag and getting the object from the DOM. But I'll use your suggestion and try the xhr method again - much less complicated.
[quote]
Can't, it's on a server that's not yet publicly available - we're doing a website redev. I can supply source code from the browser if that helps.
I've just realised that the asset lister with the json in it doesn't have a url, as it's in a folder outside our new site asset. This may be why the getJSON method is failing.
[quote]
I've just realised that the asset lister with the json in it doesn't have a url, as it's in a folder outside our new site asset. This may be why the getJSON method is failing.
M
[/quote]
Yeah, it needs a URL for it to work with that jQuery method.