PDA

View Full Version : Javascript Strings???


sandie
09-25-2002, 02:49 PM
I am writing a Web-page using MS Frontpage. NowI have been trying to use the "string.split(' ')" method to create an array of words from some long string. I get an ERROR message: "Object doesn't support this method or property". I found out about this method from this website. Is there some class I am supposed to include here or what??

Any help will be very much appreciated.

ShriekForth
09-25-2002, 03:57 PM
Just make sure that it is a string. The following will show an alert with "Words" in it.

<script>
myString = new String("String Of Words");
StrArr = myString.split(" ")
alert(StrArr[2]);
</script>

ShriekForth