标签:style color ar sp div on bs ad as
局部刷新中显示图片:
错误写法:var innerDiv = "<p class=‘town_con‘ id=‘city1‘>";
var div;
div = innerDiv+"<img style=‘width:340px; height:210px;‘ src = ‘"+<%=request.getContextPath() %>+“/UploadCityImages/”+data[0].picSrc + "‘/></p>";
$(‘#city1‘).append(div);
红色部分写错了
正确:
var innerDiv = "<p class=‘town_con‘ id=‘city1‘>";
var div;
div = innerDiv+"<img style=‘width:340px; height:210px;‘ src = ‘"+"<%=request.getContextPath() %>/UploadCityImages/"+data[0].picSrc + "‘/></p>";
$(‘#city1‘).append(div);
写的时候只:alert(<%=request.getContextPath() %>);结果错误 没有显示结果
修改:alert(”<%=request.getContextPath() %>“)正确显示路径,猜测可能是js的budge
标签:style color ar sp div on bs ad as
原文地址:http://www.cnblogs.com/a757956132/p/4061987.html