[Javascript] Re: "Object Expected" Error

Rodney Myers rodney at aflyingstart.net
Sat May 4 06:37:51 CDT 2002


Erm ....
 how would expect the parser to cope with
string = string.substring(0,-1) ??

This is what you are doing when the "<TEXTAREA" string is not present and you
persist with your faulty if condition!

Rodney

Bludshogun at aol.com wrote:

> --- In javascript at y..., Rodney Myers <rodney at a...> wrote:
> > Try
> > if (string.indexOf("<TEXTAREA")>-1)
> >
> > Your current expression
> > string.indexOf("<TEXTAREA")
> > gives the value -1 because there is no "<TEXTAREA"
> > -1 is TRUE not FALSE!
> > Only 0 is false.
> >
> > hth
> >
> > Rodney
> >
>
> Well thanks for pointing that out but it doesn't solve my problem. I'd like
> if someone could plug this code into IE5.5 and tell me what happens. It seems
> really simple. It gets to that line:
>
> string = string.substring(0,indexOf("<TEXTAREA"))
>




More information about the Javascript mailing list