1
我需要在json中存储多行img src代码以便在jQuery中使用,但是语法有些问题。所以如果我只存储一条这样的线JSON多行图像代码
{
"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);
你是什么意思,它不起作用?控制台上是否有错误? – alkis
不,没有错误,我的意思是,json多线代码不会经过多线代码,但如果我只使用一行 - 它的工作原理 –
尝试将所有图像放在一行中。删除新行。 – alkis