CINXE.COM
<!DOCTYPE html> <html> <head> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <META HTTP-EQUIV="Expires" CONTENT="-1"> <script type="text/javascript"> function post_to_url(path, params, method) { method = method || "post"; // Set method to post by default, if not specified. // The rest of this code assumes you are not using a library. // It can be made less wordy if you use one. var form = document.createElement("form"); //Move the submit function to another variable //so that it doesn't get overwritten. form._submit_function_ = form.submit; form.setAttribute("method", method); form.setAttribute("action", path); var addField = function( key, value ){ var hiddenField = document.createElement("input"); hiddenField.setAttribute("type", "hidden"); hiddenField.setAttribute("name", key); hiddenField.setAttribute("value", value ); form.appendChild(hiddenField); }; for(var key in params) { if(params.hasOwnProperty(key)) { if( params[key] instanceof Array ){ for(var i = 0; i < params[key].length; i++){ addField( key, params[key][i] ) } } else{ addField( key, params[key] ); } } } addField( "_posted", "1" ); document.body.appendChild(form); form._submit_function_(); //Call the renamed function. } function start(){ post_to_url("/maps/", {}, "post"); } </script> <noscript> <h1>IMPOSSIBILE UTILIZZARE l'applicazione senza javascript</h1> </noscript> </head> <body onload="start();"> </body> </html>