title: Trying to call a function inside JavaScript file has no action
body: <p>I recreated my mobile application I am trying to develop using CLI this time, so that I can add my plugins in my Phonegap 3.4 with a much easiest way. <br><br>
  The problem is that in my JavaScript, when I call the <code>registerdb</code> function, nothing works fine. I mean even though I do mistake in the password or in the email text areas when I run it, I don't get any vibrate or error message as I should. <br><br>When I put in comments the calling of the <code>registerdb</code> and the function, the JavaScript works correct until it's end (it prints the alerts when every text input is correct). <br><br>So, I believe that the problem is related to the calling of function <code>registerdb</code>. Any help ?</p>
  
  <p><hr>
  My <code>.js</code> file:</p>
  
  <pre><code>document.addEventListener("deviceready", onDeviceReady, false);
  
      // PhoneGap is ready
      function onDeviceReady() {
          // Empty
      }
  
  
  // Function to add event listener to register button
  function load() { 
    var el = document.getElementById("register"); 
    el.addEventListener("click", Register, false); 
  } 
  
  document.addEventListener("DOMContentLoaded", load, false);
  
  function Register() {
    var username = document.getElementsByName('username')[0];
    var password = document.getElementsByName('password')[0];
    var email = document.getElementsByName('email')[0];
  
    if (username.value == "") {
      $("#username").focus();
      document.getElementById('username').style.boxShadow = "0 0 7px #f00";
      navigator.notification.vibrate(500);
    } 
    else{
      document.getElementById('username').style.boxShadow = "none";
    }
  
     //&gt;5 characters, 1 upper case, at least 1 lower case, at least 1 numerical character, at least 1 special character
     var passExp = /(?=^.{6,15}$)((?=.*\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[^A-Za-z0-9])(?=.*[a-z])|(?=.*[^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9]))^.*/;
     var strong_flag_pass = 0;
  
    if (!(password.value.match(passExp))) {
      $("#password").focus();
      document.getElementById('password').style.boxShadow = "0 0 7px #f00";
      navigator.notification.alert("Please enter a strong Password! It has to have at least: 6 characters, 1 upper case, 1 lower case, 1 numerical character and 1 special character!", null, 'Password', 'Okay');
      navigator.notification.vibrate(500);
      strong_flag_pass = 0;
    }
    else{
      document.getElementById('password').style.boxShadow = "none";
      strong_flag_pass = 1;
    }
  
    var emailExp = /^.+@[^\.].*\.[a-z]{2,}$/;
    var strong_flag_email = 0;
  
    if (!(email.value.match(emailExp))) {
      $("#email").focus();
      document.getElementById('email').style.boxShadow = "0 0 7px #f00";
      navigator.notification.alert("Please enter a correct Email!", null, 'Email', 'Okay');
      navigator.notification.vibrate(500);
      strong_flag_email = 0;
    }
    else {
      document.getElementById('email').style.boxShadow = "none";
      strong_flag_email = 1;
    }
  
    var gender = document.getElementById("gender").value;
  
    var about_me = document.getElementById("about-me").value;
  
    var age = document.getElementById("radio-choice").value;
  
    if (document.getElementById('radio-choice-1').checked) {
      age = document.getElementById('radio-choice-1').value;
    }
    else if (document.getElementById('radio-choice-2').checked) {
      age = document.getElementById('radio-choice-2').value;
    }
    else if (document.getElementById('radio-choice-3').checked) {
      age = document.getElementById('radio-choice-3').value;
    }
    else if (document.getElementById('radio-choice-4').checked) {
      age = document.getElementById('radio-choice-4').value;
    }
    else if (document.getElementById('radio-choice-5').checked) {
      age = document.getElementById('radio-choice-5').value;
    }
    else if (document.getElementById('radio-choice-6').checked) {
      age = document.getElementById('radio-choice-6').value;
    }
  
    if (username.value != "" &amp;&amp; strong_flag_pass == 1 &amp;&amp; strong_flag_email == 1){      
      alert(gender);
      alert(about_me);
      alert(age);
  
      //add to db
      registerdb(email, password, username, gender, about_me, age);
    }
  
  
   function registerdb(email, password, username, gender, about_me, age) {
     alert(gender);
     alert(about_me);
     alert(password;
   }
  }
  </code></pre>
  
  <hr>
  
  <p>In my <code>.html</code> the way I "call" this function is :</p>
  
  <pre><code>                            &lt;a href="#" id="register" data-role="button" data-theme="a"&gt;Register&lt;/a&gt;     
  </code></pre>