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 9110233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:13:23+00:00 2026-06-17T03:13:23+00:00

I have an HTML/JavaScript app that I’m trying to convert to an App using

  • 0

I have an HTML/JavaScript app that I’m trying to convert to an App using PhoneGap via the Phonegap Build app

Everything works fine through the browser, and the only problem the app is having is that the call to getJSON is returning a 404 error when trying to load my local resources.

Here is the culprit:

$.getJSON( "./shapes/json/" + abbr + '.json', gotJSON(abbr) );

I have whitelisted every domain, just to be sure:

<access origin="*" />

Is this something that is not possible from the phonegap environment? Or am I doing something wrong?

If needed, I can host the files elsewhere and do a cross-domain ajax call, but I’d rather have the files right there on the device.

This is currently happening on Android, which is the only system I can test at the moment.

UPDATE:

I’m now trying:

    var xhrShapes = new XMLHttpRequest(), xhrSuccess = gotJSON(abbr);

    xhrShapes.open('GET', config.path + "/shapes/json/" + abbr + ".json");
    xhrShapes.onreadystatechange = function(e){
        if( this.readyState === 4 ){
            if( this.status === xhrSuccessCode ){
                xhrSuccess(JSON.parse(this.responseText));
            }
        }
    }
    xhrShapes.send();

config.path is “file:///android_asset/www” and I’m getting 0 as a success code (which indicates success for ‘file://’ requests). but xhrShapes.responseText is blank and everything stops at the call to JSON.parse. I feel like I’m missing something simple…

  • 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-17T03:13:24+00:00Added an answer on June 17, 2026 at 3:13 am

    The problem had nothing to do with the code, but rather with the file names being case-sensitive… my abbr variable was uppercase, but filenames are lowercase. $.getJSON works perfectly, now that I’ve corrected this (though now my pride needs some repairs).

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

Sidebar

Related Questions

I have a mobile app that I developed using PhoneGap (and html/css/javascript) and there
I have been using the uiwebview for a app that consists a index.html,css and
I have an app that I'm building using the javascript API and have created
I have a jQuery Mobile PhoneGap app that loads all of my pages fine,
I have an app that I built in html and javascript that i would
I have a simple html/javascript based Android app that loads with the following code:
I am new to Android and Java. I have constructed an app using HTML/Javascript
I have an HTML app that I am trying to use on Android under
I have an html/javascript/css project that i am trying to make an Android application
I have a HTML that includes a Javascript file. This script contains a special

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.