title: passing data from methods in javascript
body: <p>Totally new to OOP in javascript, but Im trying and reading all I can. </p>
  
  <p>Ive created a simple test javascript class called Invoices. Invoices only has two methods. One method fires the other. And this part seems to be working fine.</p>
  
  <p>My problem lies with getting data objects from one method to another. I put a alert in the first method, (from my understanding) this alert should show data returned from the second method... but its not. </p>
  
  <p>Any help would be greatly appreciated. Oh.. and I am using jquery as well.</p>
  
  <p>Here is my codez.</p>
  
  <pre><code> function Invoices()
   {
    this.siteURL = "http://example.com/";
    this.controllerURL = "http://example.com/invoices/";
    this.invoiceID = $('input[name="invoiceId"]').val();
   }
  
   invoice = new Invoices;
  
   Invoices.prototype.initAdd = function()
   {
    //load customers json obj
    this.customersJSON = invoice.loadCustomers();
    alert(this.customersJSON);
  
    //create dropdown
   }
  
   Invoices.prototype.loadCustomers = function ()
   {
    $.post(this.controllerURL + "load_customers"),
    function(data)
    {
     return data;
    }
   }
  </code></pre>