title: Javascriptvoid(0) wont call function
body: <p>I have looked over my code and realized there where a few issues with the script. Now I have sorted it it will not pass through the checking you have the correct funds. i think it has something to do with the way i have declared my variable </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          var money = "&lt;?php echo $ir['money']; ?&gt;";
          var price = 5000;
          function openAccount() {
              var c = confirm("Are you sure you want to open a bank account for &lt;?=money_formatter(price)?&gt;?");
              if(c) {
                  $('#main_text').html('Opening account'); 
                  $('#main_text').append('Checking you have the correct funds'); 
                  if(+money &lt; +price) {
                      $('#main_text').append('&lt;span style="color: red;"&gt;Incorrect funds, You need another &lt;?=money_formatter((price)-$ir["money"])?&gt;...&lt;/span&gt;');         
                  } else {
                      $.post('&lt;?=file?&gt;?open=true&amp;print=1', function(data) {
                        if(data == 'not_enough_money') {
                          $('#main_text').append('Incorrect funds...');       
                        } else if(data == 'opened') {
                          $('#main_text').append('You have succesfully opened your brand new bank account!&lt;a href="javascript:void(0);"&gt;&amp;gt;View Account&lt;/a&gt;');  
                        }
                      }); 
                  }
              }
          }
  </code></pre>