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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:20:21+00:00 2026-06-14T15:20:21+00:00

I’m trying the cross platform framework phonegap and have some problems with multipages. All

  • 0

I’m trying the cross platform framework phonegap and have some problems with multipages.

All I want is the following:

  • Page 1: static content
  • Page 2: listview

The code I use:

Page 1: index.html

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="css/default.css" />

    <title>Page 1</title>

    <link rel="stylesheet" href="js/jquery.mobile-1.2.0.min.css" />
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="js/jquery.mobile-1.2.0.min.js"></script>

</head>
<body>
    <div id="static" data-role="page">

        <div data-role="header" data-position="fixed">
            <h1 id="header-text">Page 1</h1>
        </div><!-- /header -->

        <div data-role="content">
            <div id="static-content"></div>
        </div><!-- /content -->

        <div data-role="footer">
            <div data-role="navbar">
                <ul class="navbar">
                    <li><a href="index.html" class="ui-btn-active" data-transition="none">Static</a></li>
                    <li><a href="list.html" data-transition="none">Listview</a></li>
                </ul>
            </div><!-- /navbar -->
        </div><!-- /footer -->
    </div><!-- /page -->

    <script type="text/javascript" src="cordova-2.2.0.js"></script>
    <script type="text/javascript">
        document.addEventListener('deviceready', onDeviceReady, false);

        function onDeviceReady() {

            $('static-content').html('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.');

        }
    </script>
</body>

and for Page 2: list.html

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="css/default.css" />

    <title>Page 2</title>

    <link rel="stylesheet" href="js/jquery.mobile-1.2.0.min.css" />
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="js/jquery.mobile-1.2.0.min.js"></script>

</head>
<body>
    <div id="listview" data-role="page">

        <div data-role="header" data-position="fixed">
            <h1 id="header-text">Page 2</h1>
        </div><!-- /header -->

        <div data-role="content">
            <div id="list-container">
                <ul>
                    <li>item 1</li>
                    <li>item 2</li>
                    <li>item 3</li>
                </ul>
            </div>
        </div><!-- /content -->

        <div data-role="footer">
            <div data-role="navbar">
                <ul class="navbar">
                    <li><a href="index.html" data-transition="none">Static</a></li>
                    <li><a href="list.html" class="ui-btn-active" data-transition="none">Listview</a></li>
                </ul>
            </div><!-- /navbar -->
        </div><!-- /footer -->
    </div><!-- /page -->

    <script type="text/javascript" src="cordova-2.2.0.js"></script>
    <script type="text/javascript">
        document.addEventListener('deviceready', onDeviceReady, false);

        function onDeviceReady() {
            console.log('deviceready');

        }
    </script>
</body>

I want to separate the content in different files just for a better structuring. The way jquery mobile handles pages like using one index works, but is not preferred… 😉

I tried the following solutions for the navbar links:

  • a href with: rel=”external”
  • a href with: data-ajax=”false”
  • a href with: rel=”external” and data-ajax=”false”

Every time I do this with external links I get the following error:

Exception building cordova JS globals: TypeError: Cannot redefine property: connection for key "connection"

It seems like the cordova/phonegap frameworks gets loaded twice, but I thought using this links triggers a complete reload of the page, so what should be loaded twice???

Or do I have a general misunderstanding of the usage of multipages? Should be possible to separate content in different files, or?

Any help would really be great.

  • 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-14T15:20:23+00:00Added an answer on June 14, 2026 at 3:20 pm

    You need to put your scripts in the head section, which jquery mobile ignores on ajax loaded pages.

    Anything in the body gets inserted into the DOM when the second page loads, which is why Cordova is trying to run twice.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I am trying to loop through a bunch of documents I have to put
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is

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.