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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:48:22+00:00 2026-06-13T12:48:22+00:00

I want to use jQuery load to load external data on my page and

  • 0

I want to use jQuery load to load external data on my page and then let jQuery Mobile run over it again to apply themes etc with a trigger. The data is loaded fine, but it is not reskinned properly. I just put a small example together to demonstrate this, as my entire project is too big.

I have a.html:

<!DOCTYPE html> 
<html>
      <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <title>Test</title>
      <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
      <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
      <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

      <script>    
function replaceData1() {
$("#a-page").load("b.html");
$("#a-page").trigger('create');
}    
    </script>
</head> 
<body> 

<div data-role="page" id="a-page">
            <div data-role="header" data-theme="a">Header A</div><!-- /header -->

            <div data-role="content" id="a-content">
            Content A
            <button onClick="replaceData1()">goto B</button>
            </div><!-- /content -->

            <div data-role="footer">Footer A</div><!-- /footer -->

            </div><!-- /page -->
</body>
</html>

And I have b.html:

<div data-role="header" data-theme="d">Header B</div><!-- /header -->

        <div data-role="content" id="b-content">Content B</div><!-- /content -->

        <div data-role="footer">Footer B</div><!-- /footer -->

b.html is not a complete html file, just the content. I am not sure if this causes this issue or not.

Nevertheless, when I load a.html and click on the button, the contents from b.html is correctly loaded but not themed properly. Even if I execute trigger(‘create’) later, it does not work. What did I do wrong? Can somebody please rewrite this, so that it works the way I intended it?

  • 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-13T12:48:23+00:00Added an answer on June 13, 2026 at 12:48 pm

    try this

    <!DOCTYPE html>
    <html>
      <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>Test</title>
      <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
      <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
      <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
    </head>
    
    <body>
      <div data-role="page" id="a-page">
        <div data-role="header" data-theme="a">Header A</div><!-- /header -->
        <div data-role="content" id="a-content">Content A <button onClick="$.mobile.changePage('#b-page');">goto B</button></div><!-- /content -->
        <div data-role="footer">Footer A</div><!-- /footer -->
      </div><!-- /page -->
    
      <div data-role="page" id="b-page">
        <div data-role="header" data-theme="d">Header B</div><!-- /header -->
        <div data-role="content" id="b-content">Content B <button onClick="$.mobile.changePage('#a-page');">goto A</button></div><!-- /content -->
        <div data-role="footer">Footer B</div><!-- /footer -->
      </div><!-- /page -->
    
    </body>
    </html>
    

    screenshot1

    screenshot2

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

Sidebar

Related Questions

I am trying to load an external jquery page into a div. I use
I have jQuery load asset on my layout and I want to use CHtml::ajaxButton/ajaxSubmitButton
I want use JQuery mobile for the front-end of my mobile application, but I
I want to use jquery draggable/droppable to let the user select a group of
I want to use jquery's (.load) function in CI, should i place this jquery
I want to use jQuery's load function to load some content into a div,
I want to use use jQuery.load() to load some content. How do I add
Is there a way to use jquery.animate to load a page with ajax and
I want use jQuery in my project. I know the javascript_include_tag calls the jQuery
I want to use jquery autocomplete in a foreach loop. When using ids, only

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.