Not that I'm aware of without parsing the table element using the DOM
walking functions. Something like this might do it:
function tableToJSON(tableID) {
var tableData = $A();
var rows = $$("#"+tableID+" tr).each(function(row) {
var cellData = $H(row.descendants().pluck("innerHTML"));
tableData.push(cellData);
});
return tableData.toJSON();
}
But I've not tried it, nor am I sure that will work.
- Dash -
phil swenson wrote:
> Is there a way to retrieve an HTML table in javascript and convert it
> to JSON using prototype?
>
> I'm stumped :(
>
> phil
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---