[Httpunit-develop] Is httpuint support string.substring?
Brought to you by:
russgold
From: <zh...@hu...> - 2005-08-24 00:57:17
|
hi,httpunit-develop =09I have encountered one problem when I use httpunit.If I use= string.substring,my test case can't pass,error message in= JavaScript class is :ReferenceError: "check" is not defined.If I= delete "var char =3D t.substring(1)" from the script below,there= is no error occurs. I want to know whether httpunit support= string.substring. =09Thanks! =09 <script language=3D"javascript"> =09function check(){ =09=09var t =3D document.forms[0].username.value; =09=09var p =3D document.forms[0].password.value; =09=09var char =3D t.substring(1);=09 //generate error when I add this= line. =09=09if(t =3D=3D ''){ =09=09alert('please input your username'); =09=09=09document.forms[0].username.focus; =09=09}else if(p =3D=3D ''){ =09=09=09alert('please input your password'); =09=09}else{ =09=09document.forms[0].submit(); =09=09} =09} =09function check1(){ =09=09document.forms[0].action=3D"register.do"; =09=09document.forms[0].submit(); =09} =09function checkEnter(){ if(event.keyCode=3D=3D13){ check(); event.returnValue =3D false; } =09} =09function renewPassword(){ =09=09document.forms[0].action=3D"renewPassword.do"; =09=09document.forms[0].submit(); =09} =09document.forms[0].username.focus(); </script> =09 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1z...@hu... =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A12005-08-23 |