javascript代码执行问题
我用一段高度自适应代码后,发现其他的js代码无法执行了,请问是什么原因,如何解决?谢谢
代码如下:
<script type="text/javascript">
<!--
window.onload=window.onresize=function()
{
if(document.getElementById("sideLeft").clientHeight <document.getElementById("sideRight").clientHeight)
{
document.getElementById("sideLeft").style.height=document.getElementById("sideRight").offsetHeight+"px";
}
else
{
document.getElementById("sideRight").style.height=document.getElementById("sideLeft").offsetHeight+"px";
}
}
-->
</script>
你把那个function写成一个有名的function,然后分两次赋值试试。
你这个是不是一个死循环?在onload中网页中元素的大小,导致onresize的执行
id为sideLeft的元素有style属性吗?如果没有是没法设置的
相关问答:
这是我的文本框
<input type="text" size="60" name="password_answer" id="pwdanswer" value="$!password_answer" >
提交按钮
<input clas ......
我手边有csdn论坛弹出信息窗口的代码(可以从http://www.codefans.net下载),但它显示的只是固定的信息,现在想改造一下以便能通过后台调用Sql Server 2000数据库自动将数据表中的信息作为弹出窗口显示的信息。csdn论 ......
在网上找到的源码,可是执行不了,请前辈们看看,
执行+-*/是可以的
C# code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.CodeDom.Comp ......
在中firefox怎样实现javascript focus事件?谢谢!
onfocus不行吗
获取不到焦点
HTML code:
<input type="text" onfocus="javascript:alert('aaaa');" />
在火狐中没有问题的
......