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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:33:40+00:00 2026-06-01T06:33:40+00:00

I am new to mobile application development, and I am integrating Google Maps in

  • 0

I am new to mobile application development, and I am integrating Google Maps in my app by jQuery mobile. When I change pages by giving a reference to an html page, it is not showing the map. In fact, it is not getting in to the function of that file.

map.html:

   <!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100%;}
    </style>
    <script type="text/javascript"
      src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBUuNWrZ1zjJ7yKV3DJL2ylrhj9BAcYo8A&sensor=true&language=ka">
    </script>
    <script type="text/javascript">
     function initialize() {
         alert("map");
        var myOptions = {
          center: new google.maps.LatLng(17.38504, 78.48667),
          zoom: 8,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
            myOptions);
      }
   </script>

  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%"></div>

  </body>
</html>

index.html:

<!DOCTYPE html>
<head>
<title>Untitled Document</title>
        <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
</head>
<body >
    <div data-role="page" data-theme="b" data-fullscreen="true">
        <div data-role="header" >
            <h1>Home</h1>
        </div>
        <div data-role="content" data-theme="a">
            <div class="ui-grid-b">
                <a href="src/contact.html" ><img src="iphone-contacts-icon.jpg" width="72" height="72"  hspace="10" vspace="20"/></a>
                <a href="src/map.html"><img src="Maps-icon.png" width="72" height="72" hspace="10" vspace="20"/></a>
                <a><img src="ExamIcon.jpg" width="72" height="72" hspace="10" vspace="20"/></a>
            </div><!-- /grid-b -->

</div><!-- Content-->
        <div data-role="footer" >
            <h1>footer</h1>
        </div>  <!-- footer-->
    </div>  <!-- page-->


</body>
</html>

Please help.

  • 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-01T06:33:41+00:00Added an answer on June 1, 2026 at 6:33 am

    I got your pages working by rearranging some of the javascript. This is what the two html pages look like now:

    Index.html

    <!DOCTYPE html>
    <head>
    <title>Untitled Document</title>
            <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
    <script type="text/javascript"
          src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBUuNWrZ1zjJ7yKV3DJL2ylrhj9BAcYo8A&sensor=true&language=ka">
        </script>
        <script type="text/javascript">
    
          $('#Map').live("pageinit", function (event) {
             alert("map");
            var myOptions = {
              center: new google.maps.LatLng(17.38504, 78.48667),
              zoom: 8,
              mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById("map_canvas"),
                myOptions);
          });
       </script>
    </head>
    <body >
        <div data-role="page" data-theme="b" data-fullscreen="true">
            <div data-role="header" >
                <h1>Home</h1>
            </div>
            <div data-role="content" data-theme="a">
                <div class="ui-grid-b">
                    <a href="src/contact.html" ><img src="iphone-contacts-icon.jpg" width="72" height="72"  hspace="10" vspace="20"/></a>
                    <a href="map.html"><img src="Maps-icon.png" width="72" height="72" hspace="10" vspace="20"/></a>
                    <a><img src="ExamIcon.jpg" width="72" height="72" hspace="10" vspace="20"/></a>
                </div><!-- /grid-b -->
    
    </div><!-- Content-->
            <div data-role="footer" >
                <h1>footer</h1>
            </div>  <!-- footer-->
        </div>  <!-- page-->
    
    
    </body>
    </html>
    

    map.html

     <!DOCTYPE html>
    <html>
      <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
      </head>
      <body onload="initialize()">
    
        <div data-role="page" id="Map">
            <style type="text/css">
          html { height: 100%; width: 100%; }
          body { height: 100%; width: 100%; margin: 0; padding: 0 }
          #map_canvas { height: 100%; width: 100%; }
          #Map { height: 100%; width: 100%; }
        </style>
            <div id="map_canvas" style="width:100%; height:100%"></div>
        </div>
      </body>
    </html>
    

    The reason why your javascript wasn’t loading before is because jQuery Mobile doesn’t load the entire document of subsequent pages. It only loads the specified div containing the attribute data-role=”page” or if such a div doesn’t exist, it loads the body of the document.
    The reason why it doesn’t load the head of the document is because it tries to avoid loading the same scripts multiple timese.

    Hope this helps you out.

    EDIT:

    in this case you could also embed the map page into your index.html like this:

    <!DOCTYPE html>
    <head>
    <title>Untitled Document</title>
            <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
    <script type="text/javascript"
          src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBUuNWrZ1zjJ7yKV3DJL2ylrhj9BAcYo8A&sensor=true&language=ka">
        </script>
        <script type="text/javascript">
    
          $('#Map').live("pageinit", function (event) {
             alert("map");
            var myOptions = {
              center: new google.maps.LatLng(17.38504, 78.48667),
              zoom: 8,
              mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById("map_canvas"),
                myOptions);
          });
       </script>
    </head>
    <body >
        <div data-role="page" data-theme="b" data-fullscreen="true">
            <div data-role="header" >
                <h1>Home</h1>
            </div>
            <div data-role="content" data-theme="a">
                <div class="ui-grid-b">
                    <a href="src/contact.html" ><img src="iphone-contacts-icon.jpg" width="72" height="72"  hspace="10" vspace="20"/></a>
                    <a href="#Map"><img src="Maps-icon.png" width="72" height="72" hspace="10" vspace="20"/></a>
                    <a><img src="ExamIcon.jpg" width="72" height="72" hspace="10" vspace="20"/></a>
                </div><!-- /grid-b -->
    
    </div><!-- Content-->
            <div data-role="footer" >
                <h1>footer</h1>
            </div>  <!-- footer-->
        </div>  <!-- page-->
    
        <div data-role="page" id="Map">
            <style type="text/css">
          html { height: 100%; width: 100%; }
          body { height: 100%; width: 100%; margin: 0; padding: 0 }
          #map_canvas { height: 100%; width: 100%; }
          #Map { height: 100%; width: 100%; }
        </style>
            <div id="map_canvas" style="width:100%; height:100%"></div>
        </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We'll soon be embarking on the development of a new mobile application. This particular
I'm new mobile development and i'm working on an proof of concept application on
Hi there Im new to mobile application development. I had developed Android apps using
I am new to Android mobile application development. I would like to know, how
I've developed a web application for mobile. As I'm new to mobile web development
I am new to Windows Mobile and created an app that needs to do
I am new to jquery mobile, and am having problems getting content I have
I am new to jquery mobile. I have one problem. I want to increase
I am very new to windows mobile development and MSFT Sync Framework as a
i am new in blackberry development. and i have task to develop the application

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.