0

How to connect restful Web Services + phone gap. please give and sample demo.

user2497599
  • 19
  • 2
  • 6

2 Answers2

0

Try this sample

$.ajax({
    url: Your_webservice_url,
    type: "GET",
    data: {
        ModifiedSince: modifiedSince
    },
    dataType: "json",
    success: function(data) {
        console.log("The server returned " + data.length);
        //Play with the received json data.
    },
    error: function(model, response) {
        alert("Web service error: " + response.responseText);
    }
});
Amol Chakane
  • 1,501
  • 2
  • 21
  • 43
0
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?",
    function(data){
      $.each(data.items, function(i,item){
        $("<img/>").attr("src", item.media.m).appendTo("#images");
        if ( i == 3 ) return false;
      });
    });
Abdulqadir_WDDN
  • 658
  • 6
  • 22