首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

向表格写东西的有关问题

2013-07-16 
向表格写东西的问题!初始状态下 利用一个么有边框的表格容纳两个叶面。当点击管理员通道按钮后,希望通过adm

向表格写东西的问题!
初始状态下 利用一个么有边框的表格容纳两个叶面。当点击管理员通道按钮后,希望通过admin()这个函数把第二个叶面变成一个登陆的界面,只改变第二个哦。于是想在x.innerHTML=的后面用include把叶面包含近来替换原来的叶面,但是不成功,求解决方法!

function admin()
{
x=document.getElementById('log');
x.innerHTML = '';
}
</script></head>
<button type='button' onclick='admin()'>管理员通道</button>&nbsp &nbsp  
<button type='button' onclick='worklog()'>员工登录</button>&nbsp &nbsp
<button type='button' onclick='chpw()'>修改密码</button>

<center>
<table border='1' >
<tr>
<td>include_once'tab/tab.php'</td>
<td id = 'log'>include_once 'word/rightdown.html';</td>
</tr>
</table>
</center>[/code]

javascript? ajax
[解决办法]
用iframe来做就行了,动态修改iframe的src,include是服务器端的,客户端调用不了include
[解决办法]
用 jquery
<button type='button' onclick='$("#log").load("管理员通道的url")'>管理员通道</button>&nbsp &nbsp  
<button type='button' onclick='$("#log").load("员工登录的url")'>员工登录</button>&nbsp &nbsp
<button type='button' onclick='$("#log").load("修改密码的url")'>修改密码</button>
[解决办法]
你整个用iframe 布局或者 或者用框架吧
[解决办法]
html 部分加一句
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>


引用:
Quote: 引用:

用 jquery
<button type='button' onclick='$("#log").load("管理员通道的url")'>管理员通道</button>&nbsp &nbsp  
<button type='button' onclick='$("#log").load("员工登录的url")'>员工登录</button>&nbsp &nbsp
<button type='button' onclick='$("#log").load("修改密码的url")'>修改密码</button>

jquery需要安装么?

热点排行