0

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

1
  • jq("#contentid").html(wijson); this is actually working if i put some html content inside wijson . but that(wijson) contain html in the form of json .that is making problem Commented Apr 24, 2013 at 9:33

2 Answers 2

2

That content should appear as a text not as html.

Try using .text()

jquery("#content").text(wiJson);
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.