asp.net 出现方法未定义的错误。请问怎么解决 60
<divrunat="server"id="div1"onmouseover="changecolor1"onmouseout="changecolor2"><aid="...
<div runat ="server" id ="div1" onmouseover ="changecolor1" onmouseout ="changecolor2"><a id="Label1" runat ="server">mouseover and mouse out change color</a></div><br />
<script language="vbscript" runat ="server" >
Sub changecolor1()
div1.Attributes.Add("class", "bg_white")
End Sub
Sub changecolor2()
div1.Attributes.Add("class", "bg_old")
End Sub
Sub Page_Load()
</script>
每当鼠标移动到div 块时。出现changecolor1 or changecolor2 未定义。。我不是已经声明了。。哪位大大知道这个怎么解决啦。。急。。。。
我之前页面就是用js写得现在面试需要要我吧原来的全部用java javascript 转换到asp.net 搭配其编程语言 能不能用vbscript 完成上面的功能的? 展开
<script language="vbscript" runat ="server" >
Sub changecolor1()
div1.Attributes.Add("class", "bg_white")
End Sub
Sub changecolor2()
div1.Attributes.Add("class", "bg_old")
End Sub
Sub Page_Load()
</script>
每当鼠标移动到div 块时。出现changecolor1 or changecolor2 未定义。。我不是已经声明了。。哪位大大知道这个怎么解决啦。。急。。。。
我之前页面就是用js写得现在面试需要要我吧原来的全部用java javascript 转换到asp.net 搭配其编程语言 能不能用vbscript 完成上面的功能的? 展开
展开全部
改正后的代码
<div id ="div1" runat ="server" onmouseover ="changecolor1()" onmouseout ="changecolor2()">
<a id="Label1" runat ="server">mouseover and mouse out change color</a>
</div>
<br />
<script type="text/javascript">
function changecolor1(){
document.getElementById("div1").className = "bg_white";
}
function changecolor2(){
document.getElementById("div1").className = "bg_old";
}
</script>
<div id ="div1" runat ="server" onmouseover ="changecolor1()" onmouseout ="changecolor2()">
<a id="Label1" runat ="server">mouseover and mouse out change color</a>
</div>
<br />
<script type="text/javascript">
function changecolor1(){
document.getElementById("div1").className = "bg_white";
}
function changecolor2(){
document.getElementById("div1").className = "bg_old";
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询