title: Uncaught SyntaxError: Unexpected end of input at file
body: <p>I have that error when I run my phonegap Application. I reviewed my code for how many times but I can't see where my error is. After I used JSON.parse(response) that error shown but when I removed that,it executes properly. Can someone help me? Thank you</p>
  
  <p>Here's my code:</p>
  
  <pre><code>function onReconnect(position) {
  
      Lat = position.coords.latitude;
      Long = position.coords.longitude;
      d = new Date();
      date = d.getUTCDate();
      hour = d.getUTCHours() + 8;
      minutes = d.getUTCMinutes();
      secs = d.getUTCSeconds();
      year = d.getUTCFullYear();
      mon = d.getUTCMonth() + 1;
      day = d.getUTCDay();
      time = year + "-" + mon + "-" + date + " " + hour + ":" + minutes + ":" + secs;
  
      var sendData3 = {
          "name": stringValue2
      };
  
  
      $.post('http://192.168.254.110/webs/main/ajax/TimeTypeCheck.php', sendData3, function (data) {
          $("#info").html(data);
          var TCReturnMessage = data;
          var TCmess = TCReturnMessage.toString().trim();
  
          var sendData2 = {
              "name": VLmess,
              "Lat": Lat,
              "Long": Long,
              "time": time,
              "Timetype": TCmess
          };
          $.post('http://192.168.254.110/webs/main/ajax/Reconnect.php', sendData2, function (data) {
              $("#info").html(data);
              document.location.href = "TimeOnStatus.html";
          });
      });
  
  }
  
  function onError(error) {
      alert('code: ' + error.code + '\n' +
          'message: ' + error.message + '\n');
  }
  
  function onSuccess(position) {
  
      $("#Login").click(function (evt) {
  
          var currentPage = window.location.href;
          //store it
          window.sessionStorage.setItem("page", currentPage);
          //check if the previous page is the one you wanted.
  
  
          stringValue2 = window.localStorage.getItem("data");
          //stringValue2 = stringValue2.trim();
          username = $("#username").val();
          password = $("#password").val();
          d = new Date();
          date = d.getUTCDate();
          hour = d.getUTCHours() + 8;
          minutes = d.getUTCMinutes();
          secs = d.getUTCSeconds();
          year = d.getUTCFullYear();
          mon = d.getUTCMonth() + 1;
          day = d.getUTCDay();
          time = year + "-" + mon + "-" + date + " " + hour + ":" + minutes + ":" + secs;
          sendData = {
              "username": username,
              "password": password,
              "time": time
          };
  
          $.post('http://192.168.254.110/webs/main/ajax/validateLogin.php', sendData, function (data) {
              $("#info").html(data);
              var VLReturnMessage = data;
              VLmess = VLReturnMessage.toString().trim();
  
              if (VLmess != "" &amp;&amp; VLmess != "Invalid Login!") {
                  localStorage.setItem("message", VLReturnMessage);
                  window.localStorage.setItem("username", username);
                  window.localStorage.setItem("data", data);
                  sendData1 = {
                      "name": VLmess
                  };
  
                  $.post('http://192.168.254.110/webs/main/ajax/StatusCheck.php', sendData1, function (response) {
                      $("#info").html(response);
  
                      var SCReturnMessage = JSON.parse(response);
                      if (SCReturnMessage.status == "yes") {
                          navigator.geolocation.getCurrentPosition(onReconnect, onError);
  
                      } else {
                          alert("hey!");
                          var sendData4 = {
                              "name": VLmess,
                              "time": time
                          };
                          $.post('http://192.168.254.110/webs/main/ajax/AccountStatus.php', sendData4, function (data) {
                              $("#info").html(data);
                          });
                          document.location.href = "trackme.html";
  
                      }
  
                  });
  
              } else {}
  
          });
  
  
      });
  
  }
  
  
  function onError() {
      alert("Error");
  }
  </code></pre>