0

奇怪的句子..奇怪的问题。

我有一些这样的json:

  {
     "id":"1246",
     "cost":"62.1603017827",
     "material":"Blue",
     "class":"veroblue",
     "label":" ($62.16)",
     "mlabel":"Blue",
     "html":"<div class=\"quote\">\r\n\t<input type=radio name=\"QuoteUploads[selectedMaterial]\" value=\"1246\" checked=checked id=\"quote_uploads_quote_1246\" data-color=\"#A9BCF5\"\/>\r\n\t<label for=\"quote_uploads_quote_1246\" ><span class=\"swatch veroblue\"><span class=\"big veroblue\"><\/span> <\/span><span class=\"text\">Blue <span class=\"cost\">($62.16)<\/span><\/span><\/label>\r\n<\/div>\t"
  },

当我的页面加载时,上面已经在一个对象 qobj 中。当我 console.log(qobj.html) 我得到:

<div class="quote">
  <input type=radio name="QuoteUploads[selectedMaterial]" value="1250"  id="quote_uploads_quote_1250" data-color="#FBF8EF"/>
  <label for="quote_uploads_quote_1250" ><span class="swatch duruswhite"><span class="big duruswhite"></span> </span><span class="text">Polypropylene-Like <span class="cost">($62.21)</span></span></label>
</div>   

现在,当输入更改时,我通过 AJAX 重新加载 JSON 并将其存储在 qobj 中。重新加载后 console.log(qobj.html) 输出:

    </span> </span>Polypropylene-Like ($62.21)</span></span></label>
</div>   

json 字符串在通过 ajax 注入和接收时以相同的方式进行编码和呈现。有谁知道为什么会这样?

4

0 回答 0