总结一下在写系统时遇到小细节。
- iframe的使用:
iframe可以用来把一个页面分成多个部分进行处理,实现在不刷新总页面的情况下进行单独部分的页面引入。
使用时只需要在其他页面链接处设置target=" "即可。
例如:
<tr><td height=20><a href="add_kc.php" target=main>添加课程</a></td></tr>
<tr><td height=20><a href="manage_kc.php" target=main>课程管理</a></td></tr>
<tr><td height=20><a href="add_bj.php" target=main>添加班级</a></td></tr>
<tr><td height=20><a href="manage_bj.php" target=main>班级管理</a></td></tr>
<tr><td height=20><a href="add_teacher.php" target=main>添加教师</a></td></tr>
<tr><td height=20><a href="manage_teacher.php" target=main>教师管理</a></td></tr>
然后在对应的iframe模块中设置name和target对应就可以啦。
<iframe height="90%" align="bottom" width="100%" scrolling="no" name="main"></iframe>
- getElementById的使用注意
在引用的页面中使用document.getElementById的时候发现只能获取到本页面的元素标签值,要获得之前页面的标签要使用window.parent进行转换,例如:
var win=window.parent;
a=win.document.getElementById("left1");
这样就能获得相应的标签信息了。