html 显示原始文本,Json显示为HTML文本 - 不是原始格式

我正在尝试转换我必须在我的页面中显示为html文本的json数据,但是当它确实显示时它是json格式。因此,我想知道是否有可能消除所有括号等。有飞机html段落。

require(["dojo"], function (dojo){

dojo.ready(function(){

// Look up the node we'll stick the text under.

var targetNode = dojo.byId("licenseContainer");

// The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.

var xhrArgs = {

url: "",

handleAs: "text",

timeout : 2000,

load: function(data){

// Replace newlines with nice HTML tags.

data = data.replace(/\n/g, "
");

// Replace tabs with spaces.

data = data.replace(/\t/g, "   ");

targetNode.innerHTML = data;

},

error: function(error){

targetNode.innerHTML = "An unexpected error occurred: " + error;

}

}

// Call the asynchronous xhrGet

var deferred = dojo.xhrGet(xhrArgs);

});

});

目前json在我的页面上显示如下:

[{"Relevance":"Low","Name":"Clinton","id":1,,"Paragraph":Appointed secretary of state at the start of Mr Obama's first term, in January 2009, Mrs Clinton's health has been under intense scrutiny because she is considered a strong candidate for the Democratic nomination for president should she decide to run in 2016.}]

我能过滤或仅指定“段落”中的数据只是为了在html中显示吗?

任何建议或帮助都会很棒!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值