实现的功能 就是当鼠标移到该位置时,取得当前ID相对应的内容和图片.
调用代码: function move(type,k,id,p) { for(var v = 1; v<=10; v++) { if(v == id) { document.getElementById(type+'_'+k+'_'+id).style.display = ''; } else { if(document.getElementById(type+'_'+k+'_'+v) != null) { document.getElementById(type+'_'+k+'_'+v).style.display = 'none'; } } } $(function(){ if(type == 'p') { $.ajax({ beforeSend: function(){ $('#'+type+'_'+k+'_'+id).html('<div class="jpic"></div><div class="jnei">正在加载.....请稍候<div></div></div>'); }, type: "GET", url: "/tp.asp", cache : true, data: "ac=chengjiao&op=getp&id="+p, complete : function(XMLHttpRequest, textStatus){ if(textStatus == 'success') { $('#'+type+'_'+k+'_'+id).html(XMLHttpRequest.responseText); } } }); } else { $.ajax({ beforeSend: function(){ $('#'+type+'_'+k+'_'+id).html('<div class="jpic"></div><div class="jnei">正在加载.....请稍后<div></div></div>'); }, type: "GET", url: "/ts.asp", cache : true, data: "ac=chengjiao&op=getshop&id="+p, complete : function(XMLHttpRequest, textStatus){ if(textStatus == 'success') { $('#'+type+'_'+k+'_'+id).html(XMLHttpRequest.responseText); } } }); } }); }
-------------------------------------------------------
tp.asp的代码如下:
<!-- #include file="inc_shop/conobj.asp" --> <% ID=ToGetInt("ID") Set shopexe=conoboj.execute("select * from commodity where id="& ID) If shopexe.EOF Then shopexe.close Set shopexe=nothing End If %> <div class="jpic"><a href="gotp.asp?id=<%=shopexe("id")%>" target="_blank"><img src="<%=shopexe("pic")%>" width="60" height="60" name")%>" border="0"></a></div> <div class="jnei"><%=StrLen(shopexe("name"),19)%><div><a href="gotp.asp?id=<%=shopexe("id")%>" target="_blank">详情>></a></div></div>
----------------------------------------------------------
首先,如果连接的数据库是相对路径.是没有问题..是成功的.
因为我想调用子目录的数据库内容.所以调用数据库用的是绝对路径.e:\clientweb\65a\lfxy520\wwwroot\lfxy520_db\lfxy520
问题就出现了,调不出内容和图片,始终显示:"正在加载.....请稍候"
请问这是什么原因呢????