所以我用新的布局更新了这个网页..现在我似乎无法从数据库中获取图像。
旧代码:
for (i = 0 ; i < inspirationItems.length; i++)
{
var item = inspirationItems[i];
$("#participantContainer").append(
"<div class='inspirationItemContainer sharkbox top'>" +
"<img style='margin-left: 3px;' class='inspirationItem imagebox' interestId='" + item.InterestId + "' participantId='" + item.ParticipantId + "' src='/Infrastructure/ServeImage.aspx?Size=150&MemberId=" + item.MemberId + "&ImageId=" + item.ImageId + "'><br>" +
"<div class='inspirationItem' style='width: 90px; height: 40px; overflow: hidden' interestId='" + item.InterestId + "' participantId='" + item.ParticipantId + "'>" + item.Name + "</div>" +
"<div style='position:absolute; right: 3px; bottom: 3px;'><img style='width: 40px; height: 40px' src='/images/icons/" + item.Interest + ".png'></div>" +
"</div>");
}
新守则:
for (i = 0 ; i < inspirationItems.length; i++) {
var item = inspirationItems[i];
var obj = jQuery.parseJSON(item.InterestDetails);
$("#participantContainer").append(
"<div class=' inspirationItemContainer sharkbox col-sm-6 col-md-3'> " +
// "<div img style='margin-left: 3px;' class='thumbnail inspirationItem imagebox' interestId='" + item.InterestId + "' participantId='" + item.ParticipantId + "' src='/Infrastructure/ServeImage.aspx?Size=150&MemberId=" + item.MemberId + "&ImageId=" + item.ImageId + "'><br>"<
"<div class='thumbnail inspirationItem' interestId='" + item.InterestId + "' participantId='" + item.ParticipantId + "'> <img class=' imagebox' src='/Infrastructure/ServeImage.aspx?Size=150&MemberId=" + item.MemberId + "&ImageId=" + item.ImageId + "' /> " +
"<div class='inspirationItem caption' interestId='" + item.InterestId + "' participantId='" + item.ParticipantId + "'>" +
"<h3>" + item.Name + " </h3>" +
//"<p> " + obj.PartOfTown + obj.Level + "</p>" + "</div></div></div>"
谁能告诉我我做错了什么?