<html>
<head><title>学习</title></head>
<script language="javascript">
function abc()
{
if(document.getElementById("yuan").innerText=="在在在")
document.all.yuan.style.display="none"
}
</script>
<body>
<div id="yuan">在在在</div>
</body>
</html>
这样
document.all.yuan.style.display="none"这句写错了
<head><title>学习</title></head>
<script language="javascript">
function abc()
{
if(document.getElementById("yuan").innerText=="在在在")
document.all.yuan.style.display="none"
}
</script>
<body>
<div id="yuan">在在在</div>
</body>
</html>
这样
document.all.yuan.style.display="none"这句写错了
还有,问一下,把一个TEXT里面的内容清空用
document.all.getElementByName("AFFICHE/EMPLOYEENAME").innerText="";
行吗??AFFICHE/EMPLOYEENAME是name名字
document.all.getElementByName("AFFICHE/EMPLOYEENAME").innerText="";可以。
不过我喜欢用document.all.getElementByName("AFFICHE/EMPLOYEENAME").value="";
一般来说,Textbox用value,Label用innerText。
关于value和innerText的区别,你可以参考http://topic.csdn.net/t/20020710/18/864474.html
你在JSP得到值后就直接传给JS别在中间加个HTML了
另: innerText FF不支持,还是用 innerHTML吧或者: 直接用JSP写在页面上这比较好,就是取出值后如果是管理员应该显示什么,不是又应该是什么,这样在显示源代码里也看不到什么
你用页面传值,将会员身份从上个页面传过来,onload判断。如:
function window_onload()
{
if(window.parent.ASTR_IsLogin == "1")//ASTR_IsLogin为上个页面传过来的值
{
document.getElementById("div的id").style.display="block";//不隐藏
}
else
{
document.getElementById("div的id").style.display="none";//隐藏
}
}
不知对你有启发没?
document.all.divid.style.display="none";
我用meta自动转载,值应该怎么保留,XML保留在本机吗
XML我也只知道基础,差到只看得懂基础的意思,
你在父窗口中定义全局变量ASTR_IsLogin=0,在window_onload()方法中ASTR_IsLogin=1。
子窗口中写一个方法Logout(登出),在这个方法中ASTR_IsLogin=0
<script language="javascript">
function abc()
{
var textvalue=document.from.textname.value;
window.location="jspname.jsp?key='textvalue';//在onClick中提交
}
</script>
在新页中用var yuan=<%=request.getParameter("key")%>得到那个值,在onLoad中判断,隐藏一些<div></div>的文字老师说你的不行,反正我都没做出来,因为我用的是普元的EOS开发平台,有点麻烦,做不出来也是他稳定性有关
<script language="javascript">
var yuan=document.all.getElementById("abc").value;
function abc()
{
document.yuanhaolin.action="实验.html";
}
</script>
<form name="yuanhaolin">
<input type="button" onclick="abc()">
<input type="hidden" value="1" id="abc">
</form>
//实验.html
<script language="javascript">
function yuan()
{
ho=window.parent.yuan.value;
alert(ho);
}
</script>
<select>
<option>1</option>
<option selected>2</option>
</select><body onLoad="yuan();">
</body>
怎么跳不动??