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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:06:58+00:00 2026-06-12T22:06:58+00:00

I’m using JQuery Mobile 1.2.0 version. I want to put some html code in

  • 0

I’m using JQuery Mobile 1.2.0 version.
I want to put some html code in this context:

<div id="div-primeros" data-role="collapsible" data-theme="a" data-content-theme="c" data-collapsed="false">
        <h2>Primeros</h2>
        [I WANT TO ADD CODE DYNAMICALLY HERE] 
</div>

And the code I want to add is:

<div class="ui-grid-a">
    <div class="ui-block-a" style="width:93%">
        <ul data-role="listview" style="width:100%">
            <li id="4" data-icon="false">
                <a href="index.html">
                    <img src="some.jpg"></img>
                    <h3>some text</h3>
                    <span class="ui-li-count">some text</span>
                </a>
            </li>
        </ul>
    </div>
    <div class="ui-grid-b" style="width:7%">
        <input cant="1" type="number" value="0" min="0" max="8" style="width:100%">
    </div>
</div>

So I tried doing this using this code (“primero” is a JSON variable):

$("#div-primeros").append(
            "<div id=\"" + i + "\" data-role=\"listview\" class=\"ui-grid-a\">" +
                "<div class=\"ui-block-a\" style=\"width:95%\">" +
                    "<ul style=\"width:100%\">" +
                        "<li id=\"" + primero.id + "\" data-icon=\"false\">" +
                            "<a href=\"menu_detalle.html\">" +
                                "<img src=\"" + primero.thumb + "\"></img>" +
                                "<h3>" + primero.nombre + "</h3>" +
                                "<p>" + primero.descripcion + "</p>" +
                                "<span class=\"ui-li-count\">" + primero.precio + "</span>" +
                            "</a>" + 
                        "</li>" +
                    "</ul>" +
                "</div>" + 
                "<div class=\"ui-grid-b\" style=\"width:5%\">" +
                    "<input cant=\"" + primero.id + "\" type=\"number\" value=\"0\" min=\"0\" max=\"8\" style=\"width:100%\">" +
                "</div>" +
            "</div>");

The result is that the content not formatted correctly, and this content is out of collapsible “div-primeros”.

What am I doing wrong??? I’ve tried with:

    $("div-primeros").trigger("create");

and

    $("div-primeros").page();

with no successful results.

Anyone knows how can I refresh all the code?
Thank you so much!!!

Bye

  • 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-12T22:06:59+00:00Added an answer on June 12, 2026 at 10:06 pm

    Don’t break it up in multiple lines, use single quotes in place of the double quotes surrounding the html you want to append. Like so:

    $('#div-primeros').append('<div class="ui-grid-a"><div class="ui-block-a" style="width:93%"><ul data-role="listview" style="width:100%"><li id="4" data-icon="false"><a href="index.html"><img src="some.jpg"></img><h3>some text</h3><span class="ui-li-count">some text</span></a></li></ul></div><div class="ui-grid-b" style="width:7%"><input cant="1" type="number" value="0" min="0" max="8" style="width:100%"></div></div>');
    

    Here’s a fiddle. http://jsfiddle.net/wU6pr/

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

Sidebar

Related Questions

I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I want to construct a data frame in an Rcpp function, but when I
I have thousands of HTML files to process using Groovy/Java and I need to

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.