title: save data to database with click of button/link
body: <p>I am making a simple jQuery mobile app, where one of the pages is about a restaurant. 
  On that page, I want to have a button that, when clicked, saves the information of the restaurant to a database.</p>
  
  <p>I already have a php code that can save data to my database, and i have this javascript code that works together with it.
  Though this is used for saving data from a google maps <code>infowindow</code> when closed. I just need a on click button.</p>
  
  <pre><code>var url = "phpsqlinfo_addrow.php?name=" + name + "&amp;address=" + address + "&amp;description=" + description + "&amp;lat=" + latlng.lat() + "&amp;lng=" + latlng.lng();
  downloadUrl(url, function (data, responseCode) {
      if (responseCode == 200 &amp;&amp; data.length &lt;= 1) {
          infowindow.close();
          document.getElementById("message").innerHTML = "Location added.";
      }
  }
  </code></pre>
  
  <p>What is the easiest approach to this?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>Is it possible to do like this, if i create a button with id #btn_save :</p>
  
  <blockquote>
    <p>$(document).ready(function() {
    $(document).on("click","#btn_save",function() {
    "phpsqlinfo_addrow.php?name=" + john + "&amp;address=" + lolstreet 12 +
    "&amp;description=" + this is restaurant john + "&amp;lat=" + xx.xx() +
    "&amp;lng=" + yy.yy();</p>
    
    <p>}); });</p>
  </blockquote>
  
  <p>Sorry, i know i should be learning the basics first.. :/</p>