读书人

程序有一个函数参数的有关问题不知道

发布时间: 2012-03-15 11:50:38 作者: rapoo

程序有一个函数参数的问题,不知道该怎么办请帮忙看看八,谢谢!

response.write " <tr bgcolor= "&bgclr& " style= 'cursor:hand; ' onmouseover=this.style.backgroundColor= 'lightblue ' onmouseout=this.style.backgroundColor= ' ' onclick= 'doit(11,22) '> "


上面这样写程序正常,能取出参数的值


response.write " <tr bgcolor= "&bgclr& " style= 'cursor:hand; ' onmouseover=this.style.backgroundColor= 'lightblue ' onmouseout=this.style.backgroundColor= ' ' onclick= 'doit(aa,bb) '> "


上面这样写报错 'aa '未定义


response.write " <tr bgcolor= "&bgclr& " style= 'cursor:hand; ' onmouseover=this.style.backgroundColor= 'lightblue ' onmouseout=this.style.backgroundColor= ' ' onclick= 'doit( 'aa ', 'bb ') '> "


上面这样写不报错 但也没有功能


response.write " <tr bgcolor= "&bgclr& " style= 'cursor:hand; ' onmouseover=this.style.backgroundColor= 'lightblue ' onmouseout=this.style.backgroundColor= ' ' onclick= 'doit( "aa ", "bb ") '> "


上面这样写报错
Microsoft VBScript 编译器错误 错误 '800a0401 '

语句未结束

/ehongjimeng/yixiangkehuluru.asp,行173

response.write " <tr bgcolor= "&bgclr& " style= 'cursor:hand; ' onmouseover=this.style.backgroundColor= 'lightblue ' onmouseout=this.style.backgroundColor= ' ' onclick= 'doit( "aa ", "bb ") '> "
----------------------------------------------------------------------------------------------^
错误指向aa中的第一个a


下面是配套的doit()函数,好象和它联系不大
function doit(yxs1,yxs2)
{

document.form2.textfield2.value = yxs1;
document.form2.textfield3.value = yxs2;

}
谢谢,该怎么办啊?

[解决办法]
response.write " <tr bgcolor= "&bgclr& " style= 'cursor:hand; ' onmouseover=this.style.backgroundColor= 'lightblue ' onmouseout=this.style.backgroundColor= ' ' onclick= 'doit( " "aa " ", " "bb " ") '> "
试试这个。

读书人网 >ASP

热点推荐