[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-20 Thread kangax

On Nov 20, 6:29 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi Jay,
>
> Good point about documentation; would you raise a ticket for that as
> well and assign it to me (if it lets you)?  (I'm pitching in on
> documentation a bit.)  And yes, as far as I know Prototype basically
> doesn't support quirks mode, I think in quirks mode you'll run into
> some other problems.  I really should have picked up on it at the
> outset.

Yep. Many of dimension/position-related methods are unreliable when
running in quirks mode. I agree that we should stress it in the docs.

>
> -- T.J. :-)

[...]

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-20 Thread T.J. Crowder

Hi Jay,

Good point about documentation; would you raise a ticket for that as
well and assign it to me (if it lets you)?  (I'm pitching in on
documentation a bit.)  And yes, as far as I know Prototype basically
doesn't support quirks mode, I think in quirks mode you'll run into
some other problems.  I really should have picked up on it at the
outset.

-- T.J. :-)

On Nov 20, 10:28 am, Jay <[EMAIL PROTECTED]> wrote:
> Thanks very much for pointing me in the right direction on this. I
> wonder if there should be somewhere a caveat to the effect that $$
> will only work correctly with a proper doctype. Are there other
> features of prototype or scriptaculous with a similar dependency?.
> I'll look after getting the ticket open, as well as finding out more
> about the doctype directive. This is a very responsive list, and I
> really appreciate the help.
>
> --Jay
>
> On Nov 20, 3:57 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
>
> > @Jay:
>
> > > Not sure why you think we can ignore the scenario where the case of
> > > the ID is different
>
> > You're absolutely right, we can't.  I don't know why I thought that,
> > either. :-)
>
> > @kangax:
>
> > > Does this also happen with a valid doctype?
>
> > Gah!  Good catch, kangax.  No, it doesn't!  All of the browsers work
> > with the mixed case with a proper doctype, and FF, Safari, and Opera
> > correctly return empty lists with we give the wrong case in our
> > selector.
>
> > IE6 still incorrectly finds the elements with the ID selector (though
> > not with class selectors) when we give the wrong case.  So there's an
> > issue on IE, these two selectors work find element 'aBc1' when they
> > shouldn't:
>
> > $$('table#abc1')
> > $$('#abc1')
>
> > ...although these don't find the td.De class things when then
> > shouldn't:
>
> > $$('#abc1 td.de')
> > $$('td.de')
>
> > Jay, could you open a ticket on lighthouse for that?[1]  I don't know
> > that it'll get any kind of priority given how bad IE is about IDs in
> > general (its document.getElementById also ignores case, and for that
> > matter will happily return an element with the given value as a name
> > rather than as an ID).  But since Prototype does try to smooth out
> > browser diffs.  $('abc1'), since it uses the underlying
> > document.getElementById, also has this case-insensitivity issue on IE.
>
> > [1]http://prototypejs.org/contribute
>
> > Thanks again for raising this, Jay.
> > --
> > T.J. Crowder
> > tj / crowder software / com
>
> > On Nov 20, 4:11 am, kangax <[EMAIL PROTECTED]> wrote:
>
> > > On Nov 19, 5:46 pm, Jay <[EMAIL PROTECTED]> wrote:
>
> > > > I was trying to scale down the example to the essence of the issue. Of
> > > > course, $('Contents') should be interchangeable with $$('#Contents'),
> > > > except that is the bug - it doesn't work on Safari or IE. In the real
> > > > world, I might want the selector to be more like $$('table#tblTMRoster
> > > > tbody tr td.countChecked'+i) - while there may be many tables with
> > > > such cells, I only want one table's worth. Another bug for another day
> > > > is this: even if there is only one table in the page, $$('tbody tr
> > > > td.countChecked'+i) returns not only the td's in the tbody, but also
> > > > the ones in the tfoot, and the only workaround I could come up with
> > > > was to prepend the table id on the selector to make it work.
>
> > > > Finally, while one assumes id's ought to be unique, $$('#contents')
> > > > returns an array of all elements with any case-variations like
> > > > contents, Contents, conTents, whatever. At least that bug is on
> > > > Safari, however not in Firefox nor IE. So again, if there is any way
> > > > to make Prototype.js wrap up these browser inconsistencies, it would
> > > > be a boon for the programmer.
>
> > > Does this also happen with a valid doctype?
>
> > > > Cheers,
> > > > --Jay
>
> > > [...]
>
> > > --
> > > kangax
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-20 Thread Jay

Thanks very much for pointing me in the right direction on this. I
wonder if there should be somewhere a caveat to the effect that $$
will only work correctly with a proper doctype. Are there other
features of prototype or scriptaculous with a similar dependency?.
I'll look after getting the ticket open, as well as finding out more
about the doctype directive. This is a very responsive list, and I
really appreciate the help.

--Jay

On Nov 20, 3:57 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> @Jay:
>
> > Not sure why you think we can ignore the scenario where the case of
> > the ID is different
>
> You're absolutely right, we can't.  I don't know why I thought that,
> either. :-)
>
> @kangax:
>
> > Does this also happen with a valid doctype?
>
> Gah!  Good catch, kangax.  No, it doesn't!  All of the browsers work
> with the mixed case with a proper doctype, and FF, Safari, and Opera
> correctly return empty lists with we give the wrong case in our
> selector.
>
> IE6 still incorrectly finds the elements with the ID selector (though
> not with class selectors) when we give the wrong case.  So there's an
> issue on IE, these two selectors work find element 'aBc1' when they
> shouldn't:
>
> $$('table#abc1')
> $$('#abc1')
>
> ...although these don't find the td.De class things when then
> shouldn't:
>
> $$('#abc1 td.de')
> $$('td.de')
>
> Jay, could you open a ticket on lighthouse for that?[1]  I don't know
> that it'll get any kind of priority given how bad IE is about IDs in
> general (its document.getElementById also ignores case, and for that
> matter will happily return an element with the given value as a name
> rather than as an ID).  But since Prototype does try to smooth out
> browser diffs.  $('abc1'), since it uses the underlying
> document.getElementById, also has this case-insensitivity issue on IE.
>
> [1]http://prototypejs.org/contribute
>
> Thanks again for raising this, Jay.
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 20, 4:11 am, kangax <[EMAIL PROTECTED]> wrote:
>
> > On Nov 19, 5:46 pm, Jay <[EMAIL PROTECTED]> wrote:
>
> > > I was trying to scale down the example to the essence of the issue. Of
> > > course, $('Contents') should be interchangeable with $$('#Contents'),
> > > except that is the bug - it doesn't work on Safari or IE. In the real
> > > world, I might want the selector to be more like $$('table#tblTMRoster
> > > tbody tr td.countChecked'+i) - while there may be many tables with
> > > such cells, I only want one table's worth. Another bug for another day
> > > is this: even if there is only one table in the page, $$('tbody tr
> > > td.countChecked'+i) returns not only the td's in the tbody, but also
> > > the ones in the tfoot, and the only workaround I could come up with
> > > was to prepend the table id on the selector to make it work.
>
> > > Finally, while one assumes id's ought to be unique, $$('#contents')
> > > returns an array of all elements with any case-variations like
> > > contents, Contents, conTents, whatever. At least that bug is on
> > > Safari, however not in Firefox nor IE. So again, if there is any way
> > > to make Prototype.js wrap up these browser inconsistencies, it would
> > > be a boon for the programmer.
>
> > Does this also happen with a valid doctype?
>
> > > Cheers,
> > > --Jay
>
> > [...]
>
> > --
> > kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-20 Thread T.J. Crowder

@Jay:

> Not sure why you think we can ignore the scenario where the case of
> the ID is different

You're absolutely right, we can't.  I don't know why I thought that,
either. :-)

@kangax:

> Does this also happen with a valid doctype?

Gah!  Good catch, kangax.  No, it doesn't!  All of the browsers work
with the mixed case with a proper doctype, and FF, Safari, and Opera
correctly return empty lists with we give the wrong case in our
selector.

IE6 still incorrectly finds the elements with the ID selector (though
not with class selectors) when we give the wrong case.  So there's an
issue on IE, these two selectors work find element 'aBc1' when they
shouldn't:

$$('table#abc1')
$$('#abc1')

...although these don't find the td.De class things when then
shouldn't:

$$('#abc1 td.de')
$$('td.de')

Jay, could you open a ticket on lighthouse for that?[1]  I don't know
that it'll get any kind of priority given how bad IE is about IDs in
general (its document.getElementById also ignores case, and for that
matter will happily return an element with the given value as a name
rather than as an ID).  But since Prototype does try to smooth out
browser diffs.  $('abc1'), since it uses the underlying
document.getElementById, also has this case-insensitivity issue on IE.

[1] http://prototypejs.org/contribute

Thanks again for raising this, Jay.
--
T.J. Crowder
tj / crowder software / com

On Nov 20, 4:11 am, kangax <[EMAIL PROTECTED]> wrote:
> On Nov 19, 5:46 pm, Jay <[EMAIL PROTECTED]> wrote:
>
>
>
> > I was trying to scale down the example to the essence of the issue. Of
> > course, $('Contents') should be interchangeable with $$('#Contents'),
> > except that is the bug - it doesn't work on Safari or IE. In the real
> > world, I might want the selector to be more like $$('table#tblTMRoster
> > tbody tr td.countChecked'+i) - while there may be many tables with
> > such cells, I only want one table's worth. Another bug for another day
> > is this: even if there is only one table in the page, $$('tbody tr
> > td.countChecked'+i) returns not only the td's in the tbody, but also
> > the ones in the tfoot, and the only workaround I could come up with
> > was to prepend the table id on the selector to make it work.
>
> > Finally, while one assumes id's ought to be unique, $$('#contents')
> > returns an array of all elements with any case-variations like
> > contents, Contents, conTents, whatever. At least that bug is on
> > Safari, however not in Firefox nor IE. So again, if there is any way
> > to make Prototype.js wrap up these browser inconsistencies, it would
> > be a boon for the programmer.
>
> Does this also happen with a valid doctype?
>
>
>
> > Cheers,
> > --Jay
>
> [...]
>
> --
> kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread kangax

On Nov 19, 5:46 pm, Jay <[EMAIL PROTECTED]> wrote:
> I was trying to scale down the example to the essence of the issue. Of
> course, $('Contents') should be interchangeable with $$('#Contents'),
> except that is the bug - it doesn't work on Safari or IE. In the real
> world, I might want the selector to be more like $$('table#tblTMRoster
> tbody tr td.countChecked'+i) - while there may be many tables with
> such cells, I only want one table's worth. Another bug for another day
> is this: even if there is only one table in the page, $$('tbody tr
> td.countChecked'+i) returns not only the td's in the tbody, but also
> the ones in the tfoot, and the only workaround I could come up with
> was to prepend the table id on the selector to make it work.
>
> Finally, while one assumes id's ought to be unique, $$('#contents')
> returns an array of all elements with any case-variations like
> contents, Contents, conTents, whatever. At least that bug is on
> Safari, however not in Firefox nor IE. So again, if there is any way
> to make Prototype.js wrap up these browser inconsistencies, it would
> be a boon for the programmer.

Does this also happen with a valid doctype?

>
> Cheers,
> --Jay

[...]

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Jay

I was trying to scale down the example to the essence of the issue. Of
course, $('Contents') should be interchangeable with $$('#Contents'),
except that is the bug - it doesn't work on Safari or IE. In the real
world, I might want the selector to be more like $$('table#tblTMRoster
tbody tr td.countChecked'+i) - while there may be many tables with
such cells, I only want one table's worth. Another bug for another day
is this: even if there is only one table in the page, $$('tbody tr
td.countChecked'+i) returns not only the td's in the tbody, but also
the ones in the tfoot, and the only workaround I could come up with
was to prepend the table id on the selector to make it work.

Finally, while one assumes id's ought to be unique, $$('#contents')
returns an array of all elements with any case-variations like
contents, Contents, conTents, whatever. At least that bug is on
Safari, however not in Firefox nor IE. So again, if there is any way
to make Prototype.js wrap up these browser inconsistencies, it would
be a boon for the programmer.

Cheers,
--Jay

On Nov 19, 1:57 pm, "Alex Mcauley" <[EMAIL PROTECTED]>
wrote:
> $$() with # does not return anything more in the array than one element
> because id's should be unique ... its in the 
> docshttp://www.prototypejs.org/api/utility/dollar-dollar
>
> $$('#contents');
> // -> same as $('contents'), only it returns an array anyway (even though
> IDs must be unique within a document).
> you will be better off using $('abc') to gather your results as its cross
> browser and works as expected on all platforms supportedRegards
> Alex
>
> - Original Message -
> From: "Jay" <[EMAIL PROTECTED]>
> To: "Prototype & script.aculo.us" 
> Sent: Wednesday, November 19, 2008 4:34 PM
> Subject: [Proto-Scripty] cross browser $$ selector problems
>
> > Hi All,
>
> > I seem to be painted into a corner with use of $$ with respect to case
> > sensitivity of the id attribute of html elements. I get completely
> > opposite results between Firefox, Safari, and IE. All three work
> > differently. With an id such as "aBc", Firefox can only find it with $$
> > ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> > i.e. not at all case sensitive. I have a test case below - just run on
> > different browsers, and you will see different results.
>
> > Thanks,
> > --Jay
>
> > 
> > 
> > test4
> > http://ussda.demosphere.com/common/js/ps1.8.1/
> > prototype.js" language="JavaScript" type="text/javascript">
> > 
> > 
>
> >   mixed case 
> > 
>
> > 
> > var Test$$ = {
>
> >  test: function(x){
> >    return '\n $$("'+x+'").length = ' + $$(x).length;
> >  },
>
> >  setup: function() {
> >    var s = navigator.userAgent + ':';
> >    [true,false].each(function(dcase){
> >      s += '\n';
> >      ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
> >        if (dcase) x = x.toLowerCase();
> > s += Test$$.test(x);
> >      })
> >    })
> >    alert(s);
> >  }
>
> > }
>
> > document.observe('dom:loaded', function(){
> >  Test$$.setup();
> > });
>
> > 
>
> > 
> > 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Jay

Yes, you have captured the essence of the issue - unexpectedly
inconsistent results across browsers, with no apparent workaround
except to make all id's and all class names lower case. On my tests
using Windows XP Pro SP3, the browser versions were Firefox 3.0.4, IE
6.0.2900, and Safari 3.2. On the Mac OS X 10.5.4, I only have Safari
3.1.2, and it gives the same results as the Windows version.

Not sure why you think we can ignore the scenario where the case of
the ID is different: since case is significant, Safari and IE should
not find it, yet they do. Only Firefox properly finds no match.

On Nov 19, 2:41 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi Jay,
>
> Thanks for this.  We can ignore the results for when the case of the
> ID you're requesting is different from the case of the ID on the
> table, since case is significant in IDs[1] -- not that I'm surprised
> to see that IE is, um, different there.
>
> So to my mind, that leaves us with this anomalous result:  If you have
> an element with an ID containing at least one upper-case character,
> the ID is not matched by selectors such as $$('#MyID') or $$
> ('table#MyID').  You should be getting back an array with one element;
> you're getting back no elements.  The selector works if the ID is in
> all lower-case (I checked).  Naturally, you can get around this using $
> (), but that's not necessarily the point. :-)
>
> Separately, a second result I noticed looking at the above:  Class
> selectors don't work on Safari if the class has an upper-case
> character in it.  Your element with the class "De" doesn't get matched
> by $$('td.De'), but it does if I change the class and selector to both
> be all lower-case.
>
> Does that capture it?
>
> Thanks again,
>
> [1]http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2
>
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 19, 4:34 pm, Jay <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I seem to be painted into a corner with use of $$ with respect to case
> > sensitivity of the id attribute of html elements. I get completely
> > opposite results between Firefox, Safari, and IE. All three work
> > differently. With an id such as "aBc", Firefox can only find it with $$
> > ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> > i.e. not at all case sensitive. I have a test case below - just run on
> > different browsers, and you will see different results.
>
> > Thanks,
> > --Jay
>
> > 
> > 
> > test4
> > http://ussda.demosphere.com/common/js/ps1.8.1/
> > prototype.js" language="JavaScript" type="text/javascript">
> > 
> > 
>
> >           mixed case 
> > 
> > 
>
> > 
> > var Test$$ = {
>
> >   test: function(x){
> >     return '\n $$("'+x+'").length = ' + $$(x).length;
> >   },
>
> >   setup: function() {
> >     var s = navigator.userAgent + ':';
> >     [true,false].each(function(dcase){
> >       s += '\n';
> >       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
> >         if (dcase) x = x.toLowerCase();
> >         s += Test$$.test(x);
> >       })
> >     })
> >     alert(s);
> >   }
>
> > }
>
> > document.observe('dom:loaded', function(){
> >   Test$$.setup();
>
> > });
>
> > 
>
> > 
> > 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread T.J. Crowder

Sorry for the double-post:  What version of Safari are you using and
on what platform?  I've replicated the results in my post with Safari
3.1.2 for Windows on Windows XP.

-- T.J.

On Nov 19, 7:41 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi Jay,
>
> Thanks for this.  We can ignore the results for when the case of the
> ID you're requesting is different from the case of the ID on the
> table, since case is significant in IDs[1] -- not that I'm surprised
> to see that IE is, um, different there.
>
> So to my mind, that leaves us with this anomalous result:  If you have
> an element with an ID containing at least one upper-case character,
> the ID is not matched by selectors such as $$('#MyID') or $$
> ('table#MyID').  You should be getting back an array with one element;
> you're getting back no elements.  The selector works if the ID is in
> all lower-case (I checked).  Naturally, you can get around this using $
> (), but that's not necessarily the point. :-)
>
> Separately, a second result I noticed looking at the above:  Class
> selectors don't work on Safari if the class has an upper-case
> character in it.  Your element with the class "De" doesn't get matched
> by $$('td.De'), but it does if I change the class and selector to both
> be all lower-case.
>
> Does that capture it?
>
> Thanks again,
>
> [1]http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2
>
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 19, 4:34 pm, Jay <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I seem to be painted into a corner with use of $$ with respect to case
> > sensitivity of the id attribute of html elements. I get completely
> > opposite results between Firefox, Safari, and IE. All three work
> > differently. With an id such as "aBc", Firefox can only find it with $$
> > ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> > i.e. not at all case sensitive. I have a test case below - just run on
> > different browsers, and you will see different results.
>
> > Thanks,
> > --Jay
>
> > 
> > 
> > test4
> > http://ussda.demosphere.com/common/js/ps1.8.1/
> > prototype.js" language="JavaScript" type="text/javascript">
> > 
> > 
>
> >           mixed case 
> > 
> > 
>
> > 
> > var Test$$ = {
>
> >   test: function(x){
> >     return '\n $$("'+x+'").length = ' + $$(x).length;
> >   },
>
> >   setup: function() {
> >     var s = navigator.userAgent + ':';
> >     [true,false].each(function(dcase){
> >       s += '\n';
> >       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
> >         if (dcase) x = x.toLowerCase();
> >         s += Test$$.test(x);
> >       })
> >     })
> >     alert(s);
> >   }
>
> > }
>
> > document.observe('dom:loaded', function(){
> >   Test$$.setup();
>
> > });
>
> > 
>
> > 
> > 
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread T.J. Crowder

Hi Jay,

Thanks for this.  We can ignore the results for when the case of the
ID you're requesting is different from the case of the ID on the
table, since case is significant in IDs[1] -- not that I'm surprised
to see that IE is, um, different there.

So to my mind, that leaves us with this anomalous result:  If you have
an element with an ID containing at least one upper-case character,
the ID is not matched by selectors such as $$('#MyID') or $$
('table#MyID').  You should be getting back an array with one element;
you're getting back no elements.  The selector works if the ID is in
all lower-case (I checked).  Naturally, you can get around this using $
(), but that's not necessarily the point. :-)

Separately, a second result I noticed looking at the above:  Class
selectors don't work on Safari if the class has an upper-case
character in it.  Your element with the class "De" doesn't get matched
by $$('td.De'), but it does if I change the class and selector to both
be all lower-case.

Does that capture it?

Thanks again,

[1] http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2

--
T.J. Crowder
tj / crowder software / com

On Nov 19, 4:34 pm, Jay <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I seem to be painted into a corner with use of $$ with respect to case
> sensitivity of the id attribute of html elements. I get completely
> opposite results between Firefox, Safari, and IE. All three work
> differently. With an id such as "aBc", Firefox can only find it with $$
> ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> i.e. not at all case sensitive. I have a test case below - just run on
> different browsers, and you will see different results.
>
> Thanks,
> --Jay
>
> 
> 
> test4
> http://ussda.demosphere.com/common/js/ps1.8.1/
> prototype.js" language="JavaScript" type="text/javascript">
> 
> 
>
>           mixed case 
> 
>
> 
> var Test$$ = {
>
>   test: function(x){
>     return '\n $$("'+x+'").length = ' + $$(x).length;
>   },
>
>   setup: function() {
>     var s = navigator.userAgent + ':';
>     [true,false].each(function(dcase){
>       s += '\n';
>       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
>         if (dcase) x = x.toLowerCase();
>         s += Test$$.test(x);
>       })
>     })
>     alert(s);
>   }
>
> }
>
> document.observe('dom:loaded', function(){
>   Test$$.setup();
>
> });
>
> 
>
> 
> 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Alex Mcauley

$$() with # does not return anything more in the array than one element 
because id's should be unique ... its in the docs
http://www.prototypejs.org/api/utility/dollar-dollar


$$('#contents');
// -> same as $('contents'), only it returns an array anyway (even though 
IDs must be unique within a document).
you will be better off using $('abc') to gather your results as its cross 
browser and works as expected on all platforms supportedRegards
Alex
- Original Message - 
From: "Jay" <[EMAIL PROTECTED]>
To: "Prototype & script.aculo.us" 
Sent: Wednesday, November 19, 2008 4:34 PM
Subject: [Proto-Scripty] cross browser $$ selector problems


>
> Hi All,
>
> I seem to be painted into a corner with use of $$ with respect to case
> sensitivity of the id attribute of html elements. I get completely
> opposite results between Firefox, Safari, and IE. All three work
> differently. With an id such as "aBc", Firefox can only find it with $$
> ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> i.e. not at all case sensitive. I have a test case below - just run on
> different browsers, and you will see different results.
>
> Thanks,
> --Jay
>
> 
> 
> test4
> http://ussda.demosphere.com/common/js/ps1.8.1/
> prototype.js" language="JavaScript" type="text/javascript">
> 
> 
>
>   mixed case 
> 
>
> 
> var Test$$ = {
>
>  test: function(x){
>return '\n $$("'+x+'").length = ' + $$(x).length;
>  },
>
>  setup: function() {
>var s = navigator.userAgent + ':';
>[true,false].each(function(dcase){
>  s += '\n';
>  ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
>if (dcase) x = x.toLowerCase();
> s += Test$$.test(x);
>  })
>})
>alert(s);
>  }
>
> }
>
> document.observe('dom:loaded', function(){
>  Test$$.setup();
> });
>
> 
>
> 
> 
>
>
> >
> 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Jay

sorry, I meant to make the prototype library src link more generic
before sending - just point it to your favorite 1.6.0.3 link

On Nov 19, 11:34 am, Jay <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I seem to be painted into a corner with use of $$ with respect to case
> sensitivity of the id attribute of html elements. I get completely
> opposite results between Firefox, Safari, and IE. All three work
> differently. With an id such as "aBc", Firefox can only find it with $$
> ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> i.e. not at all case sensitive. I have a test case below - just run on
> different browsers, and you will see different results.
>
> Thanks,
> --Jay
>
> 
> 
> test4
> http://ussda.demosphere.com/common/js/ps1.8.1/
> prototype.js" language="JavaScript" type="text/javascript">
> 
> 
>
>           mixed case 
> 
>
> 
> var Test$$ = {
>
>   test: function(x){
>     return '\n $$("'+x+'").length = ' + $$(x).length;
>   },
>
>   setup: function() {
>     var s = navigator.userAgent + ':';
>     [true,false].each(function(dcase){
>       s += '\n';
>       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
>         if (dcase) x = x.toLowerCase();
>         s += Test$$.test(x);
>       })
>     })
>     alert(s);
>   }
>
> }
>
> document.observe('dom:loaded', function(){
>   Test$$.setup();
>
> });
>
> 
>
> 
> 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---