Posting JSON to HTML view and converting to Map.

Posting JSON to HTML view and converting to Map.

 This is in response to the following post. Got an error trying to post there so I started a new thread. http://help.zoho.com/portal/en/community/topic/500-internal-server-error-24-6-2010 

 Akash, I'm a little confused by your guidance here. I don't think that hesadanza it's trying to do a JSON "RPC'ish" post with a json body as ONE KEY. 

 When submitting an html form via ajax doing this.... 
 params : { name1 : value1,
 name2: value2, 
 name3 : value3, 
 //jquery ajax post $.post(url,params,function(data){ 
       console.log(data);
 },"json") 

Is the same as doing a regular POST html form.

 And JSON IS supported in the API... http://api.creator.zoho.com/Creator---Add-Record.html 

Akash, you are however right about one thing. POSTING to an html view (gonna need the public URL string). IS WAY EASIER than using the API. This one of the best ways to get a record into Zoho creator. Because all you have to do is convert the param to a map in the html view!! 

(Note : Note you will still need to post this to a server sides script and then pass it onto an html view. Because, it's not a true json API resource and does NOT support jsonp responses like the regular API does. ) 

Let's say you want to post some json data to Zoho.. 

//stringify my above params object using JSON.js (native in all browsers but IE). 
var myParam = JSON.stringify(params); 

 //jquery
 $.post(url,myParam); 

 In my HTML view
 
htmlpage postReceiver(myParam) 
<%{%> 
 <% myMap = myParam.toMap(); 
       name1 = myMap.get("name1"); 
       name2 = myMap.get("name2");
       name3 = myMap.get("name3"); 
 %> 
<%}%> 

 PS Ruben, thanks for helping me out with the html view POST :) Stephen Rhyne Owner Rhyne Design @srhyne