-function post_directions_result(url, directions_result) {
+function post_data(url, data) {
/* Create a new form, and add it to the DOM. Then, create a hidden
input control as a child of the form which contains the data that
we'd like to post. Finally, add the form to the document's body,
new_form.method = "post";
new_form.action = url;
var new_input = document.createElement("input");
- new_input.setAttribute("id", "directions_result");
- new_input.setAttribute("name", "directions_result");
+ new_input.setAttribute("id", "data");
+ new_input.setAttribute("name", "data");
new_input.setAttribute("type", "hidden");
- new_input.setAttribute("value", directions_result);
+ new_input.setAttribute("value", data);
new_form.appendChild(new_input);
document.body.appendChild(new_form);
new_form.submit();
if (completed_requests == total_requests) {
// Close the array, and do something with the result.
json_string += ']';
- post_directions_result('/directions/json_to_kml', json_string)
+ post_data('/directions/json_to_kml', json_string)
}
else {
// Continue the array.