隐藏网页源文件

来源:百度知道 编辑:UC知道 时间:2024/06/18 03:50:11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script>
function clear() {
Source=document.body.firstChild.data;
document.open();
document.close();
document.body.innerHTML=Source;
}
</script>
</head>

<body onload="tabit(tab1,ctab1)" onload="clear()">

大家看看代码先,现在的问题是 body如果载入了"tabit(tab1,ctab1)" 就无法隐藏源文件,如果载入了"clear()"就无法显示出表单,整个网页都看不见,能不能想办法让两者可以同时作用,或者其他方法屏蔽?

有效我给100分!

你的意思是同时在onlode事件调用两个函数吧?
修改代码为<body onload="tabit(tab1,ctab1);clear()"> 即可
或者再定义一个函数把clear与tabit函数全部包含进去也一样的。

进错了!