Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Comparing Strings


  • From: weirdit at gmail.com (Timothy White)
  • Subject: [Javascript] Comparing Strings
  • Date: Thu Aug 25 05:27:04 2005

> 1. innerHTML is a non-standard, MS-proprietary property which, although
> supported as a convenience by other browsers, doesn't have a standard
> defined behaviour;
> 
> 2. When you read the innerHTML property you are getting the string after
> it has been parsed by the browser, so although the string returned may be
> semantically identical to the value that was stuffed in there, it's
> possible that whitespace has been changed around (for example, duplicate
> spaces could have been stripped) with the result that the two strings are,
> in fact, different. Another possibility is that any HTML elements
> contained in the element whose innerHTML property you are reading would be
> returned with their tag names in upper case, but the initial value with
> which you are comparing has tag names in lower case.

Ok, so done the alert thing and yes the formatting is different.
Nothing to do with case though so I can't fix it that easily.

So what should I use instead of innerHTML?

Thanks

Tim