I posted this on script.aculo.us, but not sure that was the best place
to post this... and I can't find anything anywhere else on this, so was
hoping someone here has better insight...
We have some folks that cannot, for whatever reason, upgrade their IE
browsers. They run a combination of browsers prior to IE6SP2 on Windows
XP. They get Javascript errors, IE6SP2 and above do not. However, to
complicate things, IE6SP1 on Win2K also does not (but IE6SP1 on WinXP
does).
Browsers Affected:
Win2K - IE 5.5
WinXP - IE 5.5 and IE6SP1
The error shows as:
Line: 1283
Char: 90
Expected ')' in regular expression
Although the line it points to looks like it 'might' be okay, the line
right above it is a regexp.
1281: var params = this.params, expr = this.expression, match,
modifier, clause, rest;
1282: while (match =
expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i))
{
1283: params.attributes = params.attributes || [];
1284: params.attributes.push({name: match[2], operator: match[3],
value: match[4] || match[5] || ''});
1285: expr = match[1];
1286: }
Was there a change in the code from IE6SP1 to IE6SP2? SP2 isn't
afflicted with this error. Neither is SP1 on Win2K.
Anyone have any ideas on this? Is this even the right place to post
this?
Thanks!
Disclaimer: To be honest, I'm only figuring that the prototype.js is
where the error is. When I look at line 1283 (above and below) in the
HTML, it's right in the middle of a very plain Select/Option tag list.
There's absolutely nothing in there that would raise any flags.
That is bad form anyway, some browsers under certain conditions will
convert the "=" assignment operator to an "==" equivalence test. It is
safer to use:
while ( (expr.match = ... ) ){ ... }
Anyhow, what version of Prototype are you using? That code appears on
line 1475 of version 1.5 rc1.
IE does have some foibles with its RegExp implementation (though
probably no more overall than other browsers), you should be able to
test it independently of Prototype.js if you can work out what the
string expr is supposed to look like and what result you should get.
If you can create a test case that reliably shows the error, post on:
news:comp.lang.javascript
If your test is long, post a link to a page. If brief (say less than
20 lines of code) post the code. Don't post/link to anything that
requires Prototype.js :-)
--
Fred
Thank you very much for your reply. I will forward it on to the powers
that be (or in this case, the powers that are still contemplating
supporting IE5.5+
With regards to a test case, we've been trying for the last few days to
a week to get a test box going, so we can emulate the scenario (it was
strongly suggested against downgrading our IE browsers that far due to
its dependency on the OS and the inevitability of it bringing down our
own systems).
So, your response in hand, we'll see if we still need to consider going
that far. And if so, your suggestion of a small similar case scenario
(posting resulting case results as indicated) will become most
appropriate.
Thanks again for taking the time to consider this error.
Keith D Commiskey
http://kdcinfo.com
Looking at it again, the problem is obvious: the - ? - is used as a
non-greedy operator; it isn't supported in IE <6 at least, and maybe
some versions of 6 from your testing. It will also fail in other older
browsers.
Prototype.js doesn't make much of an attempt to be compatible with
older browsers, it requires modern versions of Gecko or IE based
browsers, anything else will struggle. I don't know whether the
supported versions of browsers has ever been published, but lack of
support for IE <6 appears to be known to some at least, though I can't
find a document specifying the specific features that fail.
--
Fred
Fred <ozf...@iinet.net.au> wrote:
> Prototype.js doesn't make much of an attempt to be compatible with
> older browsers, [...] I don't know whether the
> supported versions of browsers has ever been published [...]
I don't think prototype supports any browsers that Scriptaculous
doesn't, but in either case this would be the "safe list":
http://google.com/search?btnI=mFeelingLucky&q=scriptaculous+supported+browsers
AKA: http://wiki.script.aculo.us/scriptaculous/show/SupportedBrowsers
-dave
I appreciate both y'alls feedback, and can only hope this will help
others in search of prior browser version support in many regards.
Thanks again!