Prince Kumar Sharma
Prince Kumar Sharma

Reputation: 12641

phonegap web service is not working in ios?

I have write the following code to implement webservice in ios and I have included all the js files mention there but still it is not working.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>90210 Lookup</title>
    <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
        <script type="text/javascript" src="script/xui.js"></script>
    <script type="text/javascript" charset="utf-8">
    x$.data = {};
    x$(window).load(function(e){
      x$("#returned_information").xhr("http://ws.geonames.org/postalCodeSearchJSON?postalcode=90210&maxRows=10",
        { callback: function(){
            var codes = eval("("+this.responseText+")").postalCodes; /* this should be an array */
            x$("#returned_information").html(codes[0].placeName);
          }
        }
      );
    });
    </script>
  </head>
  <body>
    <h1 id="returned_information">
      Put Stuff in Me
    </h1>
  </body>
</html>

Please tell me what I m missing in it.

Upvotes: 1

Views: 526

Answers (1)

Prince Kumar Sharma
Prince Kumar Sharma

Reputation: 12641

Example is write and u r not missing anything.I think u have to give permission to open the url . If u have not set the permission then go to open the projectname.plist file and place * in the external host attribute.Then try this.I hope it will work.

Upvotes: 1

Related Questions