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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:21:17+00:00 2026-06-17T04:21:17+00:00

I am creating a mobile app with multiple HTML pages, jquery and Phone gap.

  • 0

I am creating a mobile app with multiple HTML pages, jquery and Phone gap. I didn’t wanted to copy paste same footer in my app’s pages redundantly so I created a global footer.html and tried to load that file’s content on documents .ready() something like this.

Footer HTML

<div data-role="navbar" data-grid="d">
    <ul class="apple-navbar-ui comboSprite">
        <li><a href="../dashboard.html">Home</a></li>
        <li><a href="../contacts/contacts.html">Contacts</a></li>
        <li><a href="../applications/applications.html">Applications</a></li>
        <li><a href="settings.html">My Account</a></li>
    </ul>
</div>

Main HTML

<div data-role="page">
    <div id="footer" data-role="footer">
    </div>
</div>

$(document).ready(function () {
   $('#footer').load("footer.htm");
   $('#footer').trigger('create');
});

It loads the content of footer.html but the Jquery mobile’s UI doesn’t get rendered.

But when I changed document ready code to this

$(document).ready(function () {
   $.get('footer.htm', function (retData) {
      $('#footer').append(retData);
      $('#footer').trigger('create');
   });
});

It worked great.

So what’s the difference between these two approach ? and why did one worked and another one failed ?

  • 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-17T04:21:18+00:00Added an answer on June 17, 2026 at 4:21 am

    Actually the difference is that in your $.get() you have a callback function and you put there the $('#footer').trigger('create'); while in the .load() you didn’t put a callback function.

    You should’ve done this:

    $(document).ready(function(){
        $('#footer').load("footer.htm", function(){
            $(this).trigger('create');
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a jQuery Mobile web app, which loads some pages. For example,
I am creating a mobile app using jquery mobile, PHP using JSON for fetching
When creating a jquery mobile / phonegap app, is it ok to pass variables
I am creating an app using jQuery Mobile and PhoneGap. I delegate a button
I'm creating a mobile app to run on a phone and trying to read
I'm creating mobile app using jQuery Mobile and CodeMirror as a code editor. I'm
I am creating a mobile app using Phonegap, JQuery Mobile and Google Maps API
I have a mobile app I am creating with JQuery Mobile. When a blackberry
I'm very new to knockout and am creating a jquery mobile app wanting to
I am creating a mobile singlepage web app using jquery mobile. The webapp includes

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.