JS路徑取得的值不對 我使用如下的代碼顯示出來的photoID值為::/YYOe5J0060.jpg而實際此路徑應為:://YYO/e/5J0060.jpg這問題是出在哪?難道JS中會對字符串作什麼處理嗎?alert("<%=photoID%>"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试试看alert("<%=Replace(photoID,"/","\/")%>"); 還是不行:整個代碼如下<head><meta http-equiv="Content-Type" content="text/html; charset=big5"><link href="css/TextContent.css" style="css/text" rel="stylesheet" /><!-- #include file = "conn.asp" --><%Dim rsImaphotoID = request("photoID")if isnull(photoID) OR photoID = "" then Set rsIma = server.CreateObject("adodb.recordset") sql = "select ima04 from ima_file where ima01 = '"&request("sfd09")&"' " rsIma.open sql,conn,1,3 if not rsIma.eof then photoID = rsIma("ima04") end if set rsIma = nothing conn.close()end if%></head><body><table align="center" > <tr> <td ><img onerror="javascript:ChangeUrl(this)" src="<%=photoID%>"> <td valign="top" > <a class="linka" href="<% if request("sfd09")<>"" then response.write request("PageName")&"?sfd01="&request("sfd01")&"&sfd09="&request("sfd09")&"&ima04="&photoID else response.write request("PageName") end if%>"></a> </tr></table></body></html><Script Language = "JavaScript"> function ChangeUrl(thePhoto){thePhoto.src = "images/changeUrl.JPG";}alert("<%=Replace(photoID,"/","\/")%>"); <!--此句顯示路徑--></script> 看上去不应该没有/,没有\是可能的。<%photoID = Replace(photoID,"\","\\")photoID = Replace(photoID,"/","\/")photoID = Replace(photoID,"""","\""")%>alert("<%=photoID%>"); Cannot return from outside a function or method. 求助div显示问起,希望高手指点! js图片定位问题 dhtmlxtree 右击菜单事件 如何获取打印机列表???? 数据转换问题 为什么我用的JavaScript图片循环显示时表格与表格之间有个缝隙? 请用IE5实现 超级简单:得到文本框的值并相加 学完了html和css,想问下接下来学什么好 javascript 正则取出 <!-- --> 关于删除className的问题
alert("<%=Replace(photoID,"/","\/")%>");
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link href="css/TextContent.css" style="css/text" rel="stylesheet" />
<!-- #include file = "conn.asp" --><%
Dim rsIma
photoID = request("photoID")
if isnull(photoID) OR photoID = "" then
Set rsIma = server.CreateObject("adodb.recordset")
sql = "select ima04 from ima_file where ima01 = '"&request("sfd09")&"' "
rsIma.open sql,conn,1,3
if not rsIma.eof then
photoID = rsIma("ima04")
end if
set rsIma = nothing
conn.close()
end if
%>
</head>
<body>
<table align="center" >
<tr>
<td ><img onerror="javascript:ChangeUrl(this)" src="<%=photoID%>">
<td valign="top" >
<a class="linka" href="<%
if request("sfd09")<>"" then
response.write request("PageName")&"?sfd01="&request("sfd01")&"&sfd09="&request("sfd09")&"&ima04="&photoID
else
response.write request("PageName")
end if%>"></a>
</tr>
</table>
</body>
</html>
<Script Language = "JavaScript">
function ChangeUrl(thePhoto){
thePhoto.src = "images/changeUrl.JPG";
}
alert("<%=Replace(photoID,"/","\/")%>"); <!--此句顯示路徑-->
</script>
photoID = Replace(photoID,"\","\\")
photoID = Replace(photoID,"/","\/")
photoID = Replace(photoID,"""","\""")
%>
alert("<%=photoID%>");