怎么才能调数据库里图片组,这个是读到一组就显示一张图片,我想要读到一组全部图片显示的方法
vartravel=$('#TravelContainer').find('div[name="travel"]');if(travel.length==0)return...
var travel = $('#TravelContainer').find('div[name="travel"]');
if (travel.length == 0) return;
var tmp = '', tmp1, ta, obj;
travel.find('div[name="day"]').each(function (i) {
tmp += '<h1 class="travelTie">第<span>' + (i + 1) + '</span>天 ' + $(this).find('[name="title"]:first').html() + '</h1>';
var sid = $(this).find('[name="sceneryid"]').text();
if (sid != '') {
tmp1 = '';
ta = sid.split(',');
for (var j = 0; j < ta.length; j++) {
obj = $('#citypiclist').find('[d_id="' + ta[j] + '"]');
if (obj.length > 0) {
tmp1 += '<li style="margin:10px;width:310px; height:280px;float:left"><p style="border:1px solid #C1C1C1;width:310px; height:250px;"><a href="' + obj.attr('url') + '" title="查看' + obj.attr('p_title') + '其它线路"><img src="' + obj.attr('p_pic') + '" width="310" height="250px" /></a></p><span style="top:100px;"><a href="' + obj.attr('url') + '" title="' + obj.attr('p_title') + '">' + obj.attr('p_title') + '</a></span></li>';
}
}
这应该是数据库吧?
Dim SqlStr_13 As String = "select d_id,t_name,p_pic From [" & TablePrefix & "citypic] INNER JOIN [" & TablePrefix & "citylibrary] On p_cityid=t_id INNER JOIN [" & TablePrefix & "destination] ON p_cityid=d_cityid and d_id in (" & formatid(l.destinationid) & ")"
Dim Dr_13 As SqlDataReader = General.DataList(SqlStr_13,0)
If Dr_13.Read Then
Do
TourExStr.AppendLine(" <div url=""/line/list.aspx?cid=" & cid & "&tid=" & tid & "&did=" & Dr_13("d_id").ToString() & """ d_id=""" & Dr_13("d_id").ToString() & """ p_title=""" & Dr_13("t_name").ToString() & """ p_pic=""" & FormatPic(Dr_13("p_pic").ToString(),2) & """ ></div>")
If Dr_13.Read = false Then
Exit Do
End If
Loop
End If
Dr_13.Close() 展开
if (travel.length == 0) return;
var tmp = '', tmp1, ta, obj;
travel.find('div[name="day"]').each(function (i) {
tmp += '<h1 class="travelTie">第<span>' + (i + 1) + '</span>天 ' + $(this).find('[name="title"]:first').html() + '</h1>';
var sid = $(this).find('[name="sceneryid"]').text();
if (sid != '') {
tmp1 = '';
ta = sid.split(',');
for (var j = 0; j < ta.length; j++) {
obj = $('#citypiclist').find('[d_id="' + ta[j] + '"]');
if (obj.length > 0) {
tmp1 += '<li style="margin:10px;width:310px; height:280px;float:left"><p style="border:1px solid #C1C1C1;width:310px; height:250px;"><a href="' + obj.attr('url') + '" title="查看' + obj.attr('p_title') + '其它线路"><img src="' + obj.attr('p_pic') + '" width="310" height="250px" /></a></p><span style="top:100px;"><a href="' + obj.attr('url') + '" title="' + obj.attr('p_title') + '">' + obj.attr('p_title') + '</a></span></li>';
}
}
这应该是数据库吧?
Dim SqlStr_13 As String = "select d_id,t_name,p_pic From [" & TablePrefix & "citypic] INNER JOIN [" & TablePrefix & "citylibrary] On p_cityid=t_id INNER JOIN [" & TablePrefix & "destination] ON p_cityid=d_cityid and d_id in (" & formatid(l.destinationid) & ")"
Dim Dr_13 As SqlDataReader = General.DataList(SqlStr_13,0)
If Dr_13.Read Then
Do
TourExStr.AppendLine(" <div url=""/line/list.aspx?cid=" & cid & "&tid=" & tid & "&did=" & Dr_13("d_id").ToString() & """ d_id=""" & Dr_13("d_id").ToString() & """ p_title=""" & Dr_13("t_name").ToString() & """ p_pic=""" & FormatPic(Dr_13("p_pic").ToString(),2) & """ ></div>")
If Dr_13.Read = false Then
Exit Do
End If
Loop
End If
Dr_13.Close() 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询