title: Phonegap onclick not working
body: <p>I am new on phonegap and I am having a big problem with a button. When I execute on a browser it works perfect and insert in my DB correctly, but whe I am using phonegap developer it doesn't work, nothing happens...Could someone help me please? </p>
  
  <p>HTML CODE:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="format-detection" content="telephone=no" /&gt;
      &lt;meta name="msapplication-tap-highlight" content="no" /&gt;
      &lt;!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 --&gt;
      &lt;!--&lt;meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /&gt;--&gt;
      &lt;link rel="stylesheet" type="text/css" href="css/form_cadastrar.css" /&gt;
      &lt;link rel="stylesheet" href="css/jquery.mobile-1.2.1.min.css" /&gt;
      &lt;script src="js/jquery-1.8.3.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/jquery.mobile-1.2.1.min.js"&gt;&lt;/script&gt;
  
      &lt;title&gt;Cadastro&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
       &lt;form id="formCliente" &gt;
          &lt;div id="control"&gt;  
              &lt;div class="control-group"&gt;
                &lt;div class="cad-titulo"&gt;
                      &lt;span&gt;Posso te conhecer?&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;             
              &lt;div class="control-group"&gt;
                  &lt;label class="control-label"&gt;
                      Nome
                  &lt;/label&gt;
                  &lt;div class="controls"&gt;
                      &lt;input  type="text" autofocus name="nome" id="nome" class="campos" required="required"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
               &lt;div class="control-group"&gt;
                  &lt;label class="control-label"&gt;
                      Sobrenome
                  &lt;/label&gt;
                  &lt;div class="controls"&gt;
                      &lt;input type="text" name="sobrenome" id="sobrenome" class="campos" required="required"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
               &lt;div class="control-group"&gt;
                  &lt;label class="control-label"&gt;
                      CPF
                  &lt;/label&gt;
                  &lt;div class="controls"&gt;
                      &lt;input type="text" placeholder="888.888.888-88" name="cpf" id="cpf" class="campos" required="required"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
               &lt;div class="control-group"&gt;
                  &lt;label class="control-label"&gt;
                      Email
                  &lt;/label&gt;
                  &lt;div class="controls"&gt;
                      &lt;input type="email" name="email" id="email" class="campos" required="required"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
               &lt;div class="control-group"&gt;
                  &lt;label class="control-label"&gt;
                      Crie&amp;nbsp;uma&amp;nbsp;senha
                  &lt;/label&gt;
                  &lt;div class="controls"&gt;
                      &lt;input type="password" name="senha" id="senha1" class="campos"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
               &lt;div class="control-group"&gt;
                  &lt;label class="control-label"&gt;
                      Repita&amp;nbsp;a&amp;nbsp;senha
                  &lt;/label&gt;
                  &lt;div class="controls"&gt;
                      &lt;input type="password" name="senha2" id="senha2" class="campos"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
               &lt;div class="control-group"&gt;
                  &lt;input onclick="enviar()" type="button"&gt;&lt;span&gt;ENVIAR&lt;/span&gt;&lt;/button&gt;
                  &lt;/div&gt;
  
               &lt;div class="control-group"&gt;
                  &lt;button onClick="history.go(-1)" type="button" class="btn btn-danger"&gt;&lt;span&gt;VOLTAR&lt;/span&gt;&lt;/button&gt;
                  &lt;/div&gt;   
              &lt;/div&gt;
  
           &lt;/div&gt;   
  
          &lt;/form&gt;  
  
      &lt;/body&gt;
  
  &lt;/html&gt;    
  
        &lt;script&gt;
  function enviar(){ 
  var formula = $('#formCliente').serialize();
  
  $.ajax({
  
      type:'POST',
      data: formula,
      url:'http://localhost/teste/www/cadastrar.php',
      success: function(data){
  
      if(data == '' || data == 0){
          alert('Occoreu um erro no Banco de Dados');
          window.location = "";
      }
  
      if(data == 1){
          alert('registro salvo com sucesso'); 
           window.location.href = "login.html";   
          }
  
  
      }
  
  
  });
  
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>PHP CODE:</p>
  
  <pre><code>&lt;?php
  $hostname = 'localhost';
  $username = 'root';
  $password = 'pass';
  $database = 'mydb';
  
  try {
  $pdo = new PDO("mysql:host=$hostname;dbname=$database", $username,    
  $password, array(PDO::MYSQL_ATTR_INIT_COMMAND =&gt; "SET NAMES utf8"));
      //echo 'Conexao efetuada com sucesso!';
  }
  catch(PDOException $e)
  {
      echo $e-&gt;getMessage();
  }
  
   $sql = 'INSERT INTO usuario (nome, sobrenome, cpf, email, senha)' ;
   $sql .= 'VALUES (:nome, :sobrenome, :cpf, :email, :senha)';
  
  try {
  
  $recebeConexao = $pdo-&gt;prepare($sql);
  
  $recebeConexao-&gt;bindParam(':nome', $_POST['nome'], PDO::PARAM_STR);
  $recebeConexao-&gt;bindParam(':sobrenome', $_POST['sobrenome'],  
  PDO::PARAM_STR);
  $recebeConexao-&gt;bindParam(':cpf', $_POST['cpf'], PDO::PARAM_STR);
  $recebeConexao-&gt;bindParam(':email', $_POST['email'], PDO::PARAM_STR);
  $recebeConexao-&gt;bindParam(':senha', $_POST['senha'], PDO::PARAM_STR);
  
  $recebeConexao-&gt;execute();
  
  if($recebeConexao == true){
  $cadastro = 1;
  }else{
  $cadastro = 0;
  }
  
  
  } catch (PDOException $ex) {
  echo "Erro inserção";
  }
  echo (json_encode($cadastro));
  
  ?&gt;
  </code></pre>