views:

38

answers:

2

I'm using YAHOO.util.Dom.get in IE.

It seems to be case sensitive and YUI (2.8) can't seem to deal with. FF lets you get ID's without case sensitivity issues. I was wondering if there is a way to also do it in IE.

This link says there is a problem. But has YUI been able to get around this ?

A: 

Are you using IE8? Because it is case sensitive. I find it unlikely that the YUI developers would code around something like this.

I would prefer to not have my ids differ by case sensitivity anyway, since I am likely to copy and paste the wrong one that way. Just take the time to make your ids nice and clean and don't worry about if YUI does or doesn't have a work around.

Anthony Potts
Thanks for the advice, but you're also inferring that it's ok to have id's with the same name, (but in different case). I think you're just asking for trouble. It might work fine in java that can compile the code and tell you, but in the wild west of javascript, (even with an IDE), you're gonna get caught out and waste time finding these sort of typo bugs as javascript is like my old girlfriend that says "yes" to anything you want to do, and then doesn't complain until "run time"....
giulio
"I would prefer to not have my ids differ by case sensitivity". So, no, I was not inferring that. I do a lot of javascript, and don't find IDs to be that much of a problem regardless of case. I copy and paste them.
Anthony Potts
+1  A: 

I made a quick test for this.

http://tivac.com/yui2/giulio_id.htm

document.getElementById is NOT case-sensitive in IE < 8. It should be, it is in every other browser.

YAHOO.util.Dom.get IS case-sensitive in all browsers.

Tivac
hey.. this is pretty good.. thanks for clarifying that. But it seems that there is no way in YUI 2 to get around it. <tick>
giulio