以后我需要在json中存储一个多行img代码,以便在jquery中使用,但是语法有问题。所以如果我只存了一条这样的线
{
"captionthree":
"<img class=\"smallicon\" src=\"logos/3dmax.png\" height=\"20px\" width=\"20px\" title=\"3D Stuio Max\">"
}
它起作用了。
但是如果我放多行的话就不会了:
{
"captionthree":
"<img class=\"smallicon\" src=\"logos/3dmax.png\" height=\"20px\" width=\"20px\" title=\"3D Stuio Max\">
<img class=\"smallicon\" src=\"logos/zbrush.png\" height=\"20px\" width=\"20px\" title=\"ZBrush\">
<img class=\"smallicon\" src=\"logos/topogun.png\" height=\"20px\" width=\"20px\" title=\"Topogun\">
<img class=\"smallicon\" src=\"logos/vray.png\" height=\"20px\" width=\"20px\" title=\"V-Ray\">
<img class=\"smallicon\" src=\"logos/mari.png\" height=\"20px\" width=\"20px\" title=\"MARI Foundry\">
<img class=\"smallicon\" src=\"logos/photoshop.png\" height=\"20px\" width=\"20px\" title=\"Adobe Photoshop\">",
}
下面是我要插入的jquery行:
$('#captionthree').html(database[globalswitchNumber].captionthree);
发布于 2015-11-06 11:39:42
删除每个图像标记之前的新行。因为有了新行,所以不能作为一个字符串来处理。
https://stackoverflow.com/questions/33565739
复制相似问题