Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7829923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:58:45+00:00 2026-06-02T10:58:45+00:00

Ive been developing an application in android with phonegap. can anyone help me on

  • 0

Ive been developing an application in android with phonegap. can anyone help me on how can i call my webservice that outputs a JSON string through my android application via AJAX with jquery? thank you very much for the help.

I have this piece of code in my Jscript:

$(document).bind("mobileinit", function(){
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
});

$.ajax({
  type: "POST",
  timeout: moneTimeout,
  url: "http://10.0.2.2:49878/SampleProject.aspx?p_trxn_type=doLogin&p_phoneNumber="+phoneNumber,
  error: function (xhr, status, errorThrown)
  { 
   alert(xhr.status);
  },
  dataType : "json",
  cache:false,
  async:false,
  success: function (ret)
  {
   try{
    var jsonObj = eval('(' + ret + ')');
    alert(jsonObj.Contacts.Contact['@phoneNumber']);
    alert(jsonObj.Contacts.Contact.LastName);
    alert(ret.Contacts.Contact['@phoneNumber'])
    alert(ret.Contacts.Contact.LastName);
   }
   catch(ex){
    alert(ex.message);
   }
   console.log(ret);
   alert(ret.length);
   alert(ret);
   alert(typeof ret);
   alert("success");
  }
 });

and here is the JSON Array the i like to get from my c# webservice,:

    {"Contacts":{"Contact":{"@phoneNumber":"0002221111","@countryCode":"1","@typeCode":"73","@type":"Default, Mobile, DefaultContactNumber","@id":"04359c0dcca64638a5fcbb17b386ceed","Salutation":"Mr.","FirstName":"Tom","MiddleName":null,"LastName":"Cruise","NameSuffix":null,"PrimaryAddress":{"Street":{"#cdata-section":"3135 Teodoro Drive"},"Street2":{"#cdata-section":""},"City":{"#cdata-section":"Detroit"},"State":"MS","Country":"US","Postal":"48228"}}}

still im getting an alert: error, and it doesnt display the JSON string array from my c# webservice

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:58:50+00:00Added an answer on June 2, 2026 at 10:58 am

    If your looking for a jquery specific. Maybe this will be helpful

    $.getJSON("http://yoururl.com?jsoncallback=?",  {
           requestParam: "someValue",  },  function(data) {
            //handle data  
           }
        );
    

    For more info, you can check : http://api.jquery.com/jQuery.getJSON/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been developing android application using html5 , jquery and phonegap default provided by
As part of an application that I'm developing for Android I'd like to show
I've been developing an application that talks directly to an SSAS 2005 OLAP cube.
I've been developing a MathLink application with a function that accepts two lists, e.g.
How can I convert the Forum application I've been developing into a Rails Engine,
I have an ASP.NET MVC application that I'm working on. I've been developing it
I've been developing an application for our client and they are requesting that we
My company is developing a web application that builds in ant. I've been tasked
I've been developing an Android application using version 2.3.3 (API 10). The application simply
Im developing an application in Android that receives real-time data (via BT) and needs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.