[Help me using jquery]

[Help me using jquery]

Sorry if I'm still early in this jquery mobile learning . I want to create a login function to check the input of the username and password in my form using jquery mobile. This application will I package into the native Blackberry applications.
Here I am having difficulty in making the login function with the help of jquery to retrieve data from the field and sent to a URL on my webserver.

My code :



  1. $(document).ready(function(){
            $("#submit").click( function (){
                var username = $('#username').val();
                var password = $('#password').val();
               
                $.ajax({
                   type: "POST",
                   url : 'http://www.myurl.com/login.php',
                   cache: false,
                   data: {
                      username:$('#username').val(),
                      password:$('#password').val(),
                   },
                   dataType: "json",
                   success: function (data) {
                        if (data.response=='Success') {
                            self.location="admin.html";
                        } else {
                            jAlert('Username dan Password wrong', 'Login Failed');
                            ClearForm();
                        }
                    },
                    error : function(data) {
                           jAlert('Check your connection', 'Connection');
                   }
          });
           
        });
    });





























Please help
to use this sintax in jQuery mobile
Thank you