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

  • SEARCH
  • Home
  • 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 8146631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:04:07+00:00 2026-06-06T14:04:07+00:00

currently i using this code in phonegap application var xmlhttp = new XMLHttpRequest(); xmlhttp.open(GET,http://192.168.1.19:8080/searchMobile?categoryRequest=true,

  • 0

currently i using this code in phonegap application

var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","http://192.168.1.19:8080/searchMobile?categoryRequest=true", true);
xmlhttp.send(null);
xmlhttp.onreadystatechange = function() {alert(xmlhttp.status);
if (xmlhttp.readyState == 4) {
    var responseObject = eval("(" + xmlhttp.responseText + ")");
    var results = responseObject.result;
    if (results != null)
    {
        var resLength = results.length;
        category.length = category.length + resLength;
        for ( var i = 0; i < resLength; i++)
        {
            category.options[category.length - (resLength - i)].innerHTML = results[i].categoryName;
            $(category).selectmenu("refresh");
      }
    }
}

this code is working in android but when i run this code on iphone it gives status 0 means doesn’t work.
how can i overcome this problem
many thanks.

  • 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-06T14:04:10+00:00Added an answer on June 6, 2026 at 2:04 pm

    First as @Raymond Camden said make sure your url is white listed in the .plist. Second it is perfectly normal for you to get a status of 0 when doing AJAX from the file:// protocol. Webkit will set the status to 0 because you are doing a cross domain request which in a web browser would be blocked but in a web view, like PhoneGap uses, is perfectly okay. So in this case 0 == 200. Third get rid of eval, if you are returning JSON data use JSON.parse(xmlhttp.responseText) as it is much safer.

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

Sidebar

Related Questions

I am currently using this code to get data from a URL: NSURL *url
I'm currently using this code to get the number of subscribers to my blog:
I'm currently using this code: var gallery = $('ul#gallery').children(); $(gallery).filter(':even').not(':last').hover(function () {$(this).toggleClass('next')}); I'm trying
I'm currently using this code: com.google.javascript.jscomp.Compiler.setLoggingLevel(Level.OFF); com.google.javascript.jscomp.Compiler compiler = new com.google.javascript.jscomp.Compiler(); CompilerOptions options =
I am currently using this code to get the locations of all the touches:
i am currently using this code: <div style=width:200px; height:300px;> <img src=./imgs/Apeiron-Island-Hotel.jpg style=width:200px; height:200px;/> <input
I'm currently using this code, and it does what I want it to $('#about-link').click(function()
I am currently using this code for 2D Collision Detection in my Space Invaders
I'm currently using this code to calculate the sunrise / sunset times. (To be
I am currently using this code to grab key-strokes, but I am missing e.g.

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.