Rahul Baruri
Rahul Baruri

Reputation: 709

How to load data from another website using jquery mobile application for android ?

I want to build an app using jquery mobile and phonegap. My problem is When I try to load json data using $.ajax() method it works fine in local host but when i try this at live hosting it results nothing. Here is my code.

$.ajax({
        type: "GET",
        url: "http://rahultest.herobo.com/rbbank/login.php",
        crossDomain: true, 
        data: {id: 'rahul123', pswd:'xxxxx'},
        dataType:"json",

        success:function(data){
                if(data.status=="connected"){
                user_id=data.id;
                $.mobile.navigate("#menu");
                }
            else{
                alert("User ID and Password is incorrect");
                }

            },
        error: function(){alert("Could not connect");}
        });
});

Upvotes: 2

Views: 285

Answers (1)

Daniel Douglas
Daniel Douglas

Reputation: 3433

Have you added the domain to Phonegaps whitelist?

Upvotes: 1

Related Questions