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
- Follow-Ups:
- [Javascript] Comparing Strings
- From: Shawn Milo
- [Javascript] Comparing Strings
- From: Triche Osborne
- [Javascript] Comparing Strings
- References:
- [Javascript] Comparing Strings
- From: Timothy White
- [Javascript] Comparing Strings
- From: Nick Fitzsimons
- [Javascript] Comparing Strings
- Prev by Date: [Javascript] Iframe Permission Denied
- Next by Date: [Javascript] Iframe Permission Denied
- Previous by thread: [Javascript] Comparing Strings
- Next by thread: [Javascript] Comparing Strings
- Index(es):