How do you debug a jquery ajax app crash in a mobile app?

How do you debug a jquery ajax app crash in a mobile app?

I'm doing a pretty simple ajax transaction (submitting data) and I'm getting a complete and total app crash (everything is unresponsive, all storage is wiped out, debug console (in simulator and live) is erased etc.

  1. <script src="jquery.mobile/jquery-2.1.4.min.js"></script>
    <script src="jquery.mobile/jquery.mobile-1.4.5.min.js"></script>
  2. <script src="jquery.mobile/jquery.validate.min.js"></script>
    <script src="jquery.mobile/additional-methods.min.js"></script>

I have a really basic signup form which includes the users First & Last names, their email address, a password and phone number.

When they click "Join" the data is validated using the jquery.validate plugin, and submitted to the server. The record is inserted into the table, a confirmation email is sent to the users email address and, finally, json data is returned to the app.

The json data sent back is a really small packet:
  1. json: {"status":"OK","userid":3,"text":"Welcome to MyCoolApp!"}

My ajax code looks like this:
  1.   $.ajax({
          type: 'POST',
          url: siteURL,      // mycoolsite.com/endpoint.php
          data: strData,      first=firstname&last=lastname&email=abc@email.com&password=abcdefghi
          datatype: 'json',
          beforeSend: function() {
            //Show spinner
             $('body').addClass('ui-loading');
             $.mobile.loading('show');
          },
          timeout: 15000,
          cache: false
      }).done(function(json, textStatus, jqXHR) {
              if(json.status == "OK")
              {
                $("#profile_status").html(json.text);         // what the server said
                setUserID(json.userid);   // save the userid
                setUserState(1);          // show the user as logged in
                setFirstTime(1);          // set this here so if user restarts app before onboarding, they come back to here
  2.             if(photo)
                {
                  // if join was successful (we have a userid)
                  // then we can save any photo we may have
                  console.log("upload the photo to userid" +userid);
  3.               // set upload filename to userid.   
                }
  4.          }
              if(json.status == "FAILED")
              {
                $("profile_status").html("Your profile was not updated! The server said: " +json.text);         // what the server said
              }
      }).fail(function(xhr, textStatus, error) {
              $("profile_status").html("There was an error communicating with our server, your device said" +textStatus);         // what the server said
              console.log("saveProfile: " +textStatus);
              console.log("saveProfile: " +error);
      }).always(function(jqXHR, textStatus) {
             $.mobile.loading('hide'); 
             $('body').removeClass('ui-loading');
      });
This is really pretty minimal and I've tried everything from removing the jquery.validate calls, to removing the jquery click handler and going straight to an html onclick'"" - no matter what, this call is crashing the app.

FWIW, other calls are working just fine... for instance login (existing account).

So, how do I debug this?

Thanks,

P.