Re: Space in REGEX in IE6



On 10 May, 15:06, Duncan Booth <duncan.bo...@xxxxxxxxxxxxxxx> wrote:
Captain Paralytic <paul_laut...@xxxxxxxxx> wrote:
On 9 May, 23:00, Lee <REM0VElbspamt...@xxxxxxx> wrote:
Try the following in IE6. It works for me in IE7 and Firefox:

<html>
<body>
<script type="text/javascript">
alert("Hello there, world".replace(/ /g,''));
</script>
</body>
</html>

--

It works in IE7 and Firefox, but fails in IE6

Fails how?

It works in a completely clean IE6 installation (tested using Microsoft
Virtual PC and Microsoft's own IE6 XP image, copy/pasting the exact text
Lee posted).- Hide quoted text -

- Show quoted text -

I think you have misread the conversation!

I said, that I had an error and I specified that error as "Expected
')'"

Lee posted asking "Does it work in other browsers?".

I answered this question by saying that "It works in IE7 and Firefox,
but fails in IE6"

You then said "Fails how?"

I now refer you back to my first post where I said "However in IE6 it
complained with an "Expected ')'" error.", which answers you question
of "Fails how?", before you even asked it! Phew!!

Lee's suspicion was a problem elsewhere in my code. However it all
works fine in both IE7 and FF. If I replace

element.value = element.value.replace(/ /g,'');

with

element.value = element.value.replace(/\s/g,'');

then the error goes away.





.



Relevant Pages

  • Re: Space in REGEX in IE6
    ... It works in a completely clean IE6 installation (tested using Microsoft ... but fails in IE6" ... I now refer you back to my first post where I said "However in IE6 it ... I understood that your original code fails with "Expected ')'", ...
    (comp.lang.javascript)
  • Re: TaskSpeed results for My Library
    ... I am quite sure I will remove that novelty altogether when I ... "mylib.js attempts to support IE4 but fails to support ... Aborted` error in IE6 when a page has a BASE" ... Prototype unit tests" ...
    (comp.lang.javascript)
  • Re: Nagging mystery - why wont this page open?
    ... within PowerPoint). ... fails to open. ... If I type the same link info in the IE6 address line, ... "failing" URL into an e-mail note, where it appears as a link. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: CSS Layout Issue in IE6 - Example in Book Fails
    ... Tables Using CSS" fails in IE6. ... It works as I expect and understand in IE7 and Firefox 2. ...
    (alt.html)
  • Re: Browser hijacking?
    ... >For one particular website, I can always open it with Mozilla Firefox, but ... >access always fails when I try using IE6. ... I suspect ...
    (uk.comp.homebuilt)