help with jsonp data source

48 views
Skip to first unread message

Dee

unread,
May 1, 2012, 5:46:48 PM5/1/12
to SIMILE Widgets
Hi team,
I have a jsp file that returns json data as data source to
exhibit. Now I wanted to use jsonp so that I could make some
modifications to the returned json structure. I tried setting the
content type of the jsp file which returns the json to application/
javascript(also tried application/json) and followed live example
http://www.cheltenhamlittleleague.org/fieldmapb.html but still I
couldn't get things to work because the callback function is not
getting called.

the link tag looks like :
<link rel="exhibit/data" type="application/jsonp"
href="separateCompanyAttrFromJson.jsp?entity=product" jsonp-
callback="editgridCallback" ex:converter="fillInDetails" />

and tried to test it with something simple like :
<script>
function fillInDetails(json){
alert(json);
return json;
}
</script>

in the live example I can see that the json returned has structure
like editgridCallback({json data}) but mine one still returns plain
json without the editgridCallback, also do I need to create
editgridCallback function? even in wikki we use the same callback so I
assumed it should be in the exhibit lib. Any help would be much
appreciated.

Thanks

Dee

unread,
May 1, 2012, 6:04:42 PM5/1/12
to SIMILE Widgets
I think I made it to work - I modified the jsp page to return
editgridCallback(json string) rather than just json string.


On May 1, 5:46 pm, Dee <deewendra.shres...@gmail.com> wrote:
> Hi team,
>         I have a jsp file that returns json data as data source to
> exhibit. Now I wanted to use jsonp so that I could make some
> modifications to the returned json structure. I tried setting the
> content type of the jsp file which returns the json to application/
> javascript(also tried application/json) and followed live examplehttp://www.cheltenhamlittleleague.org/fieldmapb.htmlbut still I
Reply all
Reply to author
Forward
0 new messages