Json / Jsonp not connecting to php (Phonegap + jquerymobile)-Collection of common programming errors

  • an android WEB application
  • with phonegap
  • layout with JqueryMobile
  • An html form that takes ID, name, and address as input
  • ‘Serialize’s this data using ajax
  • makes a json object out of it
  • Should send it to a file called ‘connection.php’
  • Where, this data is put into a database (MySql)
  • My server is localhost, Im using xampp
  • I have already created a database and table using phpmyadmin
  • My html file, where my json object is created, does not connect to the php file which is hosted by my localhost
 
 
 

 
    
    

   Trial app
   
    
    
    

    
    $(document).ready(function () {
        $("#btn").click( function() {
        alert('hello hello');

        $.ajax({
            url: "connection.php",
            type: "POST",
            data: {
                id: $('#id').val(),
                name: $('#name').val(),
                Address: $('#Address').val()
            },
            datatype: "json",
            success: function (status)
            {
                if (status.success == false)
                {
                    alert("Failure!");
                }
                else 
                {
                    alert("Success!");
                }
            }
        });

    });
    });
 
 

 


        

Heading of the app

    

    
        
            
        

        
            
        

        
            
        
Add record