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属性吗?如果没有是没法设置的
相关问答:
我的源文件如下:
<html>
<head> <title>show picture </title>
<script>
function change(fileName)
{
  ......
我也来一个趣味javascript:
打开以下html文件,依次按下G,L,C三个键,就会有奇迹出现!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" ......
我手边有csdn论坛弹出信息窗口的代码(可以从http://www.codefans.net下载),但它显示的只是固定的信息,现在想改造一下以便能通过后台调用Sql Server 2000数据库自动将数据表中的信息作为弹出窗口显示的信息。csdn论 ......