anilgontla
anilgontla

Reputation: 103

jquery mobile to display html content

I am using jquery mobile and JavaScript. i have some response in a variable that response is a html content .now i have to display this html content in the UI of jquery mobile. That content should appear as a text not as html.

jquery("#content").html(wiJson);

<div data-role="content" id="content">
</div>

This is what i have used in my code jquery("#content").html(wiJson); this is used in javascript and

<div data-role="content" id="content">
        </div>

is used in jquery mobile ui

Upvotes: 0

Views: 534

Answers (2)

Harish
Harish

Reputation: 1519

You can add pre & code tags to your html and append it using .append() jQuery method. It's gonna look something like this.

jQuery('#content").append('<pre><code>wiJson</pre></code>');

Hope this helps.

Upvotes: 0

Andy
Andy

Reputation: 14575

That content should appear as a text not as html.

Try using .text()

jquery("#content").text(wiJson);

Upvotes: 2

Related Questions