X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=www%2Fmaps%2Fmaps%2Fpublic%2Fjavascripts%2Fmaputils.js;fp=www%2Fmaps%2Fmaps%2Fpublic%2Fjavascripts%2Fmaputils.js;h=45f976d30e3332b87fcf6549f1eb0d8539009da0;hb=d797c850a8493c0027b1e8b8dbc4d3e78840d4d9;hp=0000000000000000000000000000000000000000;hpb=c0a23c3492a4aa7eefa21c8c5f2a4037000a9493;p=dead%2Fcensus-tools.git diff --git a/www/maps/maps/public/javascripts/maputils.js b/www/maps/maps/public/javascripts/maputils.js new file mode 100644 index 0000000..45f976d --- /dev/null +++ b/www/maps/maps/public/javascripts/maputils.js @@ -0,0 +1,17 @@ +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, + and submit it. */ + var new_form = document.createElement("form"); + new_form.method = "post"; + new_form.action = url; + var new_input = document.createElement("input"); + new_input.setAttribute("id", "data"); + new_input.setAttribute("name", "data"); + new_input.setAttribute("type", "hidden"); + new_input.setAttribute("value", data); + new_form.appendChild(new_input); + document.body.appendChild(new_form); + new_form.submit(); +}