AJAX树型目录问题 高手来看啊~~~高分~~在线等 急!!!!!
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>";
}
?>