自动读取同网页图片路径代码,请高手帮忙修改 show.src=img1.src这行。
<divid="left_content"><%ifrule(request("ClassLayer"))=""orrule(request("TypeName"))="...
<div id="left_content"> <% if rule(request("ClassLayer"))="" or rule(request("TypeName"))="" then
show.src=img1.src
else
sql="select * from product where p_ClassLayer='"& rule(request("ClassLayer")) &"'"
end if
set rsk=conn.execute(sql)
if(not rsk.eof) then %>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="n">
<tr>
<td>><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../picture/<%=rsk("p_Picture1")%>" name="show" height="300" border="0" id="show" onerror="javascript:this.src='../picture/empty.gif'" onload="javascript:DrawImage(this,300,300)"></td>
</tr>
<tr>
<td><img src="../picture/<%=rsk("p_Picture1")%>" name="img1" border="0" id="img1" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"> <img src="../picture/<%=rsk("p_Picture2")%>" name="img2" border="0" id="img2" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"> <img src="../picture/<%=rsk("p_Picture3")%>" name="img3" border="0" id="img3" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"> <img src="../picture/<%=rsk("p_Picture4")%>" name="img4" border="0" id="img4" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"></td>
</tr>
</table> </td>
</tr>
</table>
</div> 展开
show.src=img1.src
else
sql="select * from product where p_ClassLayer='"& rule(request("ClassLayer")) &"'"
end if
set rsk=conn.execute(sql)
if(not rsk.eof) then %>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="n">
<tr>
<td>><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../picture/<%=rsk("p_Picture1")%>" name="show" height="300" border="0" id="show" onerror="javascript:this.src='../picture/empty.gif'" onload="javascript:DrawImage(this,300,300)"></td>
</tr>
<tr>
<td><img src="../picture/<%=rsk("p_Picture1")%>" name="img1" border="0" id="img1" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"> <img src="../picture/<%=rsk("p_Picture2")%>" name="img2" border="0" id="img2" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"> <img src="../picture/<%=rsk("p_Picture3")%>" name="img3" border="0" id="img3" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"> <img src="../picture/<%=rsk("p_Picture4")%>" name="img4" border="0" id="img4" onClick="show.src=this.src" onload="javascript:DrawImage(this,52,52)" onerror="javascript:this.src='../picture/empty.gif'"></td>
</tr>
</table> </td>
</tr>
</table>
</div> 展开
1个回答
展开全部
onClick="show.src=this.src"
改成:
onClick="document.getElementById('show').src=this.src"
然后还有这么修改
<% if rule(request("ClassLayer"))="" or rule(request("TypeName"))="" then%>
<script type='text/javascript'>document.getElementById('show').src=document.getElementById('img1').src</script>
<% else
改成:
onClick="document.getElementById('show').src=this.src"
然后还有这么修改
<% if rule(request("ClassLayer"))="" or rule(request("TypeName"))="" then%>
<script type='text/javascript'>document.getElementById('show').src=document.getElementById('img1').src</script>
<% else
追问
系统提示以下错误:
Microsoft VBScript compilation error '800a0400'
Expected statement
/eco/en/products.asp, line 112
^
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询