title: jQuery mobile ajax call returning SyntaxError
body: <p>I am receiving xhr.status = 200 which means good, but then the following:</p>
  
  <pre><code> SyntaxError: missing ; before statement
  </code></pre>
  
  <p>I cannot find where this error is being thrown. Here is my html:</p>
  
  <pre><code> &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /&gt;
  &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"&gt;&lt;/script&gt;
  
  &lt;div data-role="page" id="login" data-theme="a"&gt;
      &lt;div data-role="header" &gt; &lt;!-- data-theme="a" --&gt;
          &lt;h3&gt;Company Logo&lt;/h3&gt;
      &lt;/div&gt;
  
      &lt;div data-role="content"&gt;
          &lt;form name="loginForm" id="loginForm" class="ui-body ui-body-a ui-corner-all" data-ajax="false"&gt;
              &lt;fieldset&gt;
                  &lt;div data-role="fieldcontain"&gt;
                      &lt;input type="text" name="userName" id="userName" value="" placeholder="User ID"/&gt;
                  &lt;/div&gt;                                 
                  &lt;div data-role="fieldcontain"&gt;                                     
                      &lt;input type="password" name="userPassword" id="userPassword" value="" placeholder="Password" autocomplete="off"/&gt;
                  &lt;/div&gt;
                  &lt;input type="button" name="submit" id="submit" value="Login" data-theme="d" /&gt;
                  &lt;p&gt;
                  Keep me logged in? &lt;input type="checkbox" name="keepLoggedIn" id="keepLoggedIn" data-role="flipswitch"  data-theme="d"/&gt;
                  &lt;/p&gt;
              &lt;/fieldset&gt;
          &lt;/form&gt;                             
      &lt;/div&gt;
  
      &lt;div data-theme="a" data-role="footer" data-position="fixed"&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div data-role="page" id="second"&gt;
      &lt;div data-role="header"&gt;
          &lt;h3&gt;Company Logo&lt;/h3&gt;
      &lt;/div&gt;
  
      &lt;div data-role="content"&gt;
          Upload Photos
      &lt;/div&gt;
  
      &lt;div data-theme="a" data-role="footer" data-position="fixed"&gt;
          &lt;h3&gt;Page footer&lt;/h3&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is my javascript:</p>
  
  <pre><code>$(document).on('pageinit', '#login', function(){ 
  
  $(document).on('click', '#submit', function() { 
  
      if($('#userName').val().length &gt; 0 &amp;&amp; $('#userPassword').val().length &gt; 0) {
          // Send data to server through the Ajax call
          // action is functionality we want to call and outputJSON is our data
          $.ajax({
              url: "second.cfm",
              data: { action : 'getUser', 
                      formData : $('#loginForm').serialize() 
              },
              type: 'post',                  
              async: 'true',
              dataType: 'jsonp',
              contentType: "application/json",
              beforeSend: function() {
                  // This callback function will trigger before data is sent
                  $.mobile.loading("show"); // This will show ajax spinner
              },
              complete: function() {
                  // This callback function will trigger on data sent/received complete
                   $.mobile.loading("hide"); // This will hide ajax spinner
              },
              success: function (result) {
                  if(result.SUCCESS) {
                      $("#second").pagecontainer("change");           
                  } else {
                      alert('Logon unsuccessful!');
                  }
              },
              error: function(xhr,ajaxOptions,thrownError) {
                  alert('Network error has occurred please try again!');
                  alert(xhr.status);
                  alert(thrownError);
              }
          });                  
      } else {
          alert('Please fill User ID and Password!');
      }  
  
      return false; // cancel original event to prevent form submitting
  
  });   
  
  });
  </code></pre>
  
  <p>I can go to "second.cfm" without any errors. It displays:</p>
  
  <pre><code>{"MSG":"User Logged in","SUCCESS":true}
  </code></pre>
  
  <p>I played around with the returning JSON but that didn't help either. </p>
  
  <p>What do you think returns this SyntaxError? It is driving me nuts.</p>
  
  <p>Thanks in advance.</p>