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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:42:32+00:00 2026-06-17T09:42:32+00:00

I’ve got a jQuery Mobile project which is distributed in different files, e.g. <!DOCTYPE

  • 0

I’ve got a jQuery Mobile project which is distributed in different files, e.g.

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" charset="utf-8" src="cordova-2.3.0.js"></script>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />

        <link rel="stylesheet" href="css/custom.css" />

        <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
        <script src="js/methods.js"></script>
    </head>
    <body>
        <!-- Termine Page -->
        <div data-role="page" id="firstPage">
            <div data-role="header" data-position="fixed">
                <h1>Header 1</h1>
                ...
            </div><!-- /navbar -->

            <div data-role="content">
            ...
            </div>
        </div>
    </body>
</html>

secondPage.html

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" charset="utf-8" src="cordova-2.3.0.js"></script>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />

        <link rel="stylesheet" href="css/custom.css" />

        <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
        <script src="js/methods.js"></script>
    </head>
    <body>
        <div data-role="page" id="pageTwo" class="ui-page">
            <div data-role="header" data-position="fixed" id="terminDetailSeiteHeader">
            <h1>Header 2</h1>
        </div>
        <div data-role="content">
                <div id="contentToFillWithDynamicListView"></div>
            </div>
        </div>
    </body>
</html> 

Then, I got a script which should make a call to a php-Script and generate a listview:

function listViewCreation() {
    var url = 'http://www.myServer.com/myPhp.php?someParameters=1&callback=?';
        $.getJSON(url, function(data) {
            $('#contentToFillWithDynamicListView').empty();
            var collapsibleList = '<ul data-role="listview">';
            var myselfIsIncluded = 0;
            $.each(data, function(key, value) {
                collapsibleList += '<li>' + value['displayName'] + '</li>';
            });
            collapsibleList += '</ul>';

            $('#contentToFillWithDynamicListView').html(collapsibleList).trigger('create');
        });
    }

The .trigger(‘create’) leads to the error… what am I missing?

EDIT 1

listViewCreation is called the following way:

$("#pageTwo").live("pageshow", function(e, data){
    listViewCreation();
});

EDIT 2
I’m fetching remote data from a different server, that seems to be the reason for the error; but I don’t know how to solve it… I’m fetching data on both pages (1 and 2); for the first page it works, for the second it doesn’t…

$.getJSON(url, function(data) {
    ...
}
  • 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-17T09:42:33+00:00Added an answer on June 17, 2026 at 9:42 am

    I can see you are using last stable version of jQuery mobile.

    Your problem is

    trigger('create');
    

    it is not used for jQuery mobile listview restyling. You should use :

    .listview('refresh');
    

    instead. Don’t trust official jQM documentation, trigger(‘create’) should be deprecated. Every jQM widget has a function meant to refresh it, for example button(‘refresh’).

    Also don’t use trigger(‘create’) when changing header, footer or content, it won’t work, you can trigger pagecreate on the page:

    trigger('pagecreate');
    

    EDIT :

    In case of:

    Uncaught Error: cannot call methods on listview prior to
    initialization; attempted to call method ‘refresh’

    Call:

    $('#listviewid').listview().listview('refresh');
    

    First call will initialize it and second one will style it.

    Find more about this topic in this ARTICLE.

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have an autohotkey script which looks up a word in a bilingual dictionary
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
For some reason, after submitting a string like this Jack’s Spindle from a text
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.