AJAX树型目录问题 高手来看啊~~~高分~~在线等 急!!!!!

kukulu00 2007-10-26 03:09:29
RT 高手帮忙看看啊 在线等 急!!!!!



<!-- page 1 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台管理系统</title>
<script language="javascript">
var http_request=false;
var currentpos="";
function send_request(url)
{
http_request=false;
if(window.XMLHttpRequest)
{
http_request=new XML.HttpRequest();
if(http_request.overrideMimeType)
{
http_request.overrideMimeType("text/xml");
}
}
else if(window.ActiveXObject)
{
try
{
http_request=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
http_request=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){}
}
}
if(!http_request)
{
window.alert("不能创建XMLHTTPREQUEST 对象实列");
return false;
}
http_request.onreadystatechange=processRequest;
http_request.open("GET",url,true);
http_request.send(null);
}
function showRoles(obj)
{
document.getElementById(obj).parentNode.style.display="";
document.getElementById(obj).innerHTML="正在读取数据。。。";
currentpos=obj;

var a="bg_body.php?PlayPos="+obj;
//alert(a);
send_request(a);
document.getElementById(obj+"_1").className="hidecontent";
document.getElementById(obj+"_2").className="";
}
function processRequest()
{
if(http_request.readyState==4)
{
if(http_request.status==200)
{
document.getElementById(currentpos).innerHTML=http_request.responseText;
}
else
{
alert("您请求的页面有异常!");
}
}
}
function closeRoles(obj){
document.getElementById(obj).parentNode.style.display="none";
document.getElementById(obj+"_2").className="hidecontent";
document.getElementById(obj+"_1").className="";
}
</script>
<style type="text/css">
<!--
.hidecontent {display:none;}
a:link {
text-decoration: none;
color: #0000FF;
}
a:visited {
text-decoration: none;
color: #0000FF;
}
a:hover {
text-decoration: none;
color: #0000FF;
}
a:active {
text-decoration: none;
color: #0000FF;
}
a {
font-size: 14px;
}
body {
background-color: #CCCCFF;
}
body,td,th {
font-size: 14px;
}
-->
</style>
</head>
<body>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">
<div id="pos_1_1">
╋<a onClick="showRoles('pos_1')" href="javascript:void(0)">公司简介</a>
</div>
<div id="pos_1_2" class="hidecontent">
┓<a onClick="closeRoles('pos_1')" href="javascript:void(0)">公司简介</a>
</div>
</td>
</tr>
<tr style="display:none">
<td height="20" id="pos_1"> </td>
</tr>
<tr>
<td>
<div id="pos_2_1">
╋<a onClick="showRoles('pos_2')" href="javascript:void(0)">发布信息</a>
</div>
<div id="pos_2_2" class="hidecontent">
┓<a onClick="closeRoles('pos_2')" href="javascript:void(0)">发布信息</a>
</div>
</td>
</tr>
<tr style="display:none">
<td height="20" id="pos_2"> </td>
</tr>
<tr>
<td>
<div id="pos_3_1">
╋<a onClick="showRoles('pos_3')" href="javascript:void(0)">发布产品</a>
</div>
<div id="pos_3_2" class="hidecontent">
┓<a onClick="closeRoles('pos_3')" href="javascript:void(0)">发布产品</a>
</div>
</td>
</tr>
<tr style="display:none">
<td height="20" id="pos_3"> </td>
</tr>
<tr>
<td>
<div id="pos_4_1">
╋<a onClick="showRoles('pos_4')" href="javascript:void(0)">留言管理</a>
</div>
<div id="pos_4_2" class="hidecontent">
┓<a onClick="closeRoles('pos_4')" href="javascript:void(0)">留言管理</a>
</div>
</td>
</tr>
<tr style="display:none">
<td height="20" id="pos_4"> </td>
</tr>
<tr>
<td>
·<a href='frame_bg.php' target='mainFrame'>后台管理系统帮助</a>
</td>
</tr>
<tr>
<td>
·<a href='logout.php' target='mainFrame'>退出登陆</a>
</td>
</tr>
</table>
</body>
</html>


<!-- page 2 -->
<?php
header("Cache-Control: no-cache");
header("Pragma: no-cache");
header("Content-Type: text/html; charset=gb2312");
$pos=$_GET["PlayPos"];
//echo $pos;
if($pos=="pos_1")
{
echo "┠·<a href='edit_company.php' target='mainFrame'>修改公司简介</a><br>
┖·<a href='edit_company_logo.php' target='mainFrame'>修改公司LOGO及BANNER</a>";
}
if($pos=="pos_2")
{
echo "┠·<a href='new_company_info.php' target='mainFrame'>发布最新公司动态</a><br>
┠·<a href='edit_company_info.php' target='mainFrame'>公司动态相关操作</a><br>
┠·<a href='new_company_news.php' target='mainFrame'>发布最新相关新闻</a><br>
┖·<a href='edit_company_news.php' target='mainFrame'>相关新闻相关操作</a>";
}
if($pos=="pos_3")
{
echo "┠·<a href='new_products_info.php' target='mainFrame'>发布产品信息</a><br>
┖·<a href='edit_products_info.php' target='mainFrame'>修改产品信息</a>";
}
if($pos=="pos_4")
{
echo "┖·<a href='edit_messages.php' target='mainFrame'>留言数据操作</a>";
}

?>
...全文
150 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
dw23768656 2008-01-22
  • 打赏
  • 举报
回复
php?
Go 旅城通票 2008-01-22
  • 打赏
  • 举报
回复
什么问题?我猜可能是缓存的问题吧??

showRoles中的网页加个时间戳
var a="bg_body.php?PlayPos="+obj+"×pan="+escape(new Date().toString()); 
xuStanly 2008-01-22
  • 打赏
  • 举报
回复
楼主代码中有个对象XML,不知道从哪来的。
没看见引用过程。
叶子 2008-01-19
  • 打赏
  • 举报
回复
出了什么问题?
Phenlit 2008-01-18
  • 打赏
  • 举报
回复
太笼统了,不说一下出现什么问题?难道要一点点帮你看完,再看看错在哪?
非凡笨笨 2007-10-26
  • 打赏
  • 举报
回复
不知道什么问题~~~

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧