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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:57:25+00:00 2026-06-10T00:57:25+00:00

I have a PhoneGap application designed to work on multiple mobile platforms. I’m loading

  • 0

I have a PhoneGap application designed to work on multiple mobile platforms. I’m loading a dynamic HTML content from an external page on the Internet using jQuery Mobile. The problematic system is Windows Phone 7.

This is what I get from the external page, with the URL of the script tag already replaced to load from the phone instead of from the net to save bandwidth:

<script type="text/javascript" charset="utf-8" src="x-wmapp1:/app/www/test.js"></script>

This works fine on Android, iPhone and even BlackBerry when I replaced the x-wmapp1: part by a respective counterpart (e.g. file:///android_asset/www/ on Android). However, on Windows Phone 7 it doesn’t seem to work at all.

When I try to load the same URL via $.getScript function, it always returns a 404 eror, even if I try and load it with a relative path only.

Any suggestions?

  • 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-10T00:57:26+00:00Added an answer on June 10, 2026 at 12:57 am

    Try to add your js in the GapSourceDictionary.xml.

    The GapSourceDictionary.xml XML file lists all the HTML application resources. When the application starts, this XML file is read and all the files included in the list are added to the isolated storage so that it can be served by the WebBrowser control.

    For example your GapSourceDictionary.xml should look like this:

        <?xml version="1.0" encoding="utf-8"?>
        <GapSourceDictionary>
            <FilePath Value="www\index.html"/>
            <FilePath Value="www\test.css"/>
            <FilePath Value="www\phonegap-1.3.0.js"/>
            <FilePath Value="www\js\custom.js"/>
        </GapSourceDictionary>
    

    In your HTML files use relative path to specify the URL of the external script file:

        <script type="text/javascript" src="./js/custom.js"></script>
    

    EDITED

    I managed with success to dynamically load a new local JavaScript file using the following procedure. The test was successful on PhoneGap 2.0. Unfortunately the same test failed on PhoneGap 1.8.1

    Below is the source code which loads the JS dynamically:

    function dynamicJSload(url)
    {
        var script = document.createElement('script');
        script.type = "text/javascript";
        if (script.readyState)
        {
            script.onreadystatechange = function(){
                if (script.readyState == "complete" || script.readyState == "loaded"){
                    script.onreadystatechange = null;
                }
            };
        }
        script.src = url;
        document.getElementsByTagName("head")[0].appendChild(script);
    }
    

    In my page I called the function like this:

      dynamicJSload("js\\test.js");
    

    I hope this helps you.

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

Sidebar

Related Questions

Can we have multiple HTML files in Phonegap application?
I have developed the android phonegap application using html page and css. But My
I have an application made by using phonegap 1.5.0 and jquery mobile 1.1.0.... I
I am new to mobile application development with PhoneGap. I have created a form
I have never designed a database/data-model/schema from scratch, especially for a web-application. In some
I have a simple PhoneGap application as fallows: <!DOCTYPE HTML> <html> <head> <title>PhoneGap powered
I'm creating a phonegap application for multiple platforms (specifically, Playbook and iPad) that requires
I am making the phonegap android application in html,javascript and jquery.I have made the
I have used Android phonegap application for creating dynamic list with label and corresponding
I am developing a mobile application using phonegap and jquery mobile. I have this

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.