How can javascript pass data, for example from an HTML table, without using AJAX?
I am lacking the understanding of how to actually pull data, format (into json likely), and pass it.
I am trying to pass data to a php function that sends a file to the user to download. (something ajax can't handle as I understand it)
EDIT - please give an example of posting of some rather complex data.
EDIT2 - an exmample...
I populate a table via an ajax response Object. What would be a good way to get this data I am formatting into a form that I can send to a php file via a form?
function getSalesByDeviceComplete(responseObj)
{
var cashTotal = parseInt(responseObj.data[0].cash_total).toFixed(2);
var creditTotal = parseInt(responseObj.data[0].credit_total).toFixed(2);
var grandTotal = (parseInt(responseObj.data[0].cash_total) + parseInt(responseObj.data[0].credit_total)).toFixed(2);
htmlStr += '<ul>';
htmlStr += ' <li>';
htmlStr += ' <table class="ui-widget ui-widget-content contentTable">';
htmlStr += ' <thead>';
htmlStr += ' <tr class="ui-helper-reset ui-widget-header">';
htmlStr += ' <th class="contentTableKey">Payment Device</th>';
htmlStr += ' <th class="contentTableValue">Sales</th>';
htmlStr += ' </tr>';
htmlStr += ' </thead>';
htmlStr += ' <tbody>';
htmlStr += ' <tr>';
htmlStr += ' <td class="contentTableKey">Credit Card</td>';
htmlStr += ' <td class="contentTableValue">$'+creditTotal+'</td>';
htmlStr += ' </tr>';
htmlStr += ' <tr>';
htmlStr += ' <td class="contentTableKey">Cash</td>';
htmlStr += ' <td class="contentTableValue">$'+cashTotal+'</td>';
htmlStr += ' </tr>';
htmlStr += ' </tbody>';
htmlStr += ' <tfoot>';
htmlStr += ' <tr>';
htmlStr += ' <td></td>';
htmlStr += ' <td id="salesTotal" class="contentTableValue">$'+grandTotal+'</td>';
htmlStr += ' </tr>';
htmlStr += ' </tfoot>';
htmlStr += ' </table>';
htmlStr += ' </li>';
htmlStr += '</ul>';
$("#contentData").html(htmlStr);
}
The response object looks something like...
<response_GetSalesByDevice>
<data>
<cash_total>0.00</cash_total>
<credit_total>0.00</credit_total>
</data>
<success>1</success>
</response_GetSalesByDevice>
Alas, there are several response objects that are much more complex than this.