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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:51:49+00:00 2026-06-05T12:51:49+00:00

A question similar to this has been posted several time, but I cannot find

  • 0

A question similar to this has been posted several time, but I cannot find a solution that works. Hopefully, someone can help!

I am using jQuery Mobile 1.1 and jQuery 1.7.2, so I’m on the most recent stable releases. I want to create a dynamic page header. Using this HTML code, it works fine:

    <div data-role="page" id="levela">
     <div data-role="header" id="hdr_levela">
    <h1>Title</h1>
     </div>
</div>

So I then go to dynamically create the title. I change the HTML to this:

    <div data-role="page" id="levela">
     <div data-role="header" id="hdr_levela">
     </div>
</div>   

And added the following jQuery code:

    // Set the header
var dirHeader = $('#hdr_levela');
dirHeader.append('<h1>' + title+ '</h1>');

The title appears, but is not styled. I have found several posts about this. In the jQuery Mobile Documentation, it says:

“However, if you generate new markup client-side or load in content via Ajax and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (listview button, select, etc.).

For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:

$( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );

So I tried several things. After the above code, I added the following:

dirHeader.trigger("create");

This had no effect. So I tried to put it on the actual append itself:

dirHeader.append('<h1>' + folderName + '</h1>').trigger("create");

This had no effect. I then tried the process on the parent element (in this case, the id of the parent div is “levela”). So I tried this:

$('#levela').trigger("create");

This also had no effect. At this point, I am completely lost. Every solution involves doing one of the things I have tried and is just not working. I must be missing something incredibly basic but I just can’t seem to find it.

Thanks in advance for your 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-05T12:51:50+00:00Added an answer on June 5, 2026 at 12:51 pm

    You can update the content by calling .page:

    See this working Fiddle Example!

    // Set the header
    var title      = 'super hyper BuBu',
        $dirHeader = $('#hdr_levela');
    
    
    $dirHeader.append('<h1>' + title+ '</h1>').page();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A similar question has been posted at but i could not find the solution
This is similar to a question that has already been asked. However, I am
I noticed prior to posting this question that there have been similar questions posted
I know a similar question on this topic has been asked, but doesn't look
Hey a similar question has been asked before, but none that answers mine exactly.
I know this question has been asked in a similar fashion before, but I
Something similar to this question has been asked here - HTML/CSS Gradient that stops
I know this question has already been asked, but the solution doesn't work in
I know this question has been handeled in similar situations, regarding ASP.Net, before. But
This could be considered a duplicate question, as a similar one has already been

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.