Javascript jquery mobile可显示html内容

Javascript jquery mobile可显示html内容,javascript,jquery,json,html,jquery-mobile,Javascript,Jquery,Json,Html,Jquery Mobile,我正在使用jquerymobile和JavaScript。我在一个变量中有一些响应,该响应是一个html内容。现在我必须在jquery mobile的UI中显示这个html内容。该内容应显示为文本,而不是html jquery("#content").html(wiJson); <div data-role="content" id="content"> </div> 在jquery移动用户界面中使用 该内容应显示为文本,而不是html jquery("#conten

我正在使用jquerymobile和JavaScript。我在一个变量中有一些响应,该响应是一个html内容。现在我必须在jquery mobile的UI中显示这个html内容。该内容应显示为文本,而不是html

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

<div data-role="content" id="content">
</div>
在jquery移动用户界面中使用

该内容应显示为文本,而不是html

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

<div data-role="content" id="content">
</div>
尝试使用.text()


您可以将pre&code标记添加到html中,并使用.append()jQuery方法将其追加。看起来像这样

jQuery('#content").append('<pre><code>wiJson</pre></code>');
jQuery('#content”).append('
wiJson
);
希望这能有所帮助。

jq(#contentid”).html(wijson);如果我在wijson中放入一些html内容,这实际上是可行的。但是(wijson)包含json格式的html。这就产生了问题
jQuery('#content").append('<pre><code>wiJson</pre></code>');