Tag: IE
label for=”id” don’t work on IE
by z3n on Sep.27, 2010, under Coding, Tips & Hints
Problem:
<input type='radio' value='x' id='something_1' name='something'> <label for='something_1'>cool label</label>
When user clicks on the label radio should be selected, this only happens on firefox.
Solution:
$("label").click(function(){
if ($(this).attr("for") != "")
$("#" + $(this).attr("for")).click();
});
More info on this issue:
IE z-index issues
by z3n on May.28, 2010, under Tips & Hints
Problem:
IE, in all it’s versions, ignores the z-index from non child elements, meaning that if you have a div inside another with z-index it’s fine, however, if there’s an external div (99%) of the cases, it will simply ignore the z-index.
Solution:
There’s no solution for this, but you can do a workaround. Even with IE ignoring the z-indexes it does has an order of placing elements in front of the others which is the order you have them on html, so if you have a header menu that should appear in the top of everything, you can place the html in the footer of the page, with position absolute, to the header position. This might not work for all cases, but helped mine. since the div in question was hidden and would appear when a element at header was clicked.
Javascript Const Note
by z3n on Apr.13, 2010, under Notes
In order to keep my code clean i wrote a javascript with const variable declarations, those were constants anyway and there were no reason to declare them as var, right?
Wrong, big mistake, IE don’t support consts right, turns out it gives javascripts errors (on the wrong position, of course), i will not even go deep into this, cuz it will just turn into more shit, so i’m just replacing const per var;
So, note to self, never use consts on javascript.
jQuery + XML + IE = xmlDOM issue … or no??
by z3n on Aug.29, 2009, under Coding, Notes
Problem:
In the middle of the developing of a very complex script i figured out that IE was simply ignoring the xml documents i sent to it by ajax. Searching the web i’ve found this $.xmlDOM jQuery extension that is supposed to fix the IE issue with xmls. Although the extesion was clear and other people claims it work, it didn’t worked for me, how lucky is that?
Solution:
This took a while to solve, and i will skip all the boring process. Turns out that i didn’t needed the $.xmlDOM extension at all, the issue was on the xml. I’m developing this script in a language that has accents, i need to use `á` like html entities in order to avoid malfuncioning with data transport, so this little ampersand was breaking IE.
How nice is that?
An old CSS Trick
by z3n on May.30, 2008, under Tips & Hints
It’s been a long time i use this trick but i never got time to share it, so here it goes,
there are many different ways to have an specific css command to be interpreted by a IE or FF, but they are complicated some are obscure , other requires you to do a separated CSS file etc etc
here’s my trick:
.someclass {
width:250px; /* this is for FF */
//width:265px; /* this only works on IE */
}
so on FF it will ignore the commented line while IE will override the previous value with the one on the commented line; For some reason this works all IE versions i was able to test, somehow IE really loves to read the //’s , regular /* */ comments are ignored by both browsers.
that’s all.