Mobile version of this pageOne thing I hate about Linux: cron
Next:
pwdf - a mix of ls and pwd
Related blogs
jQuery and Highslide JSWhy Django and Grok matters
RememberYourFriends.com running jQuery
JetBlue a good and bad website
parentElementsByTagName(doc, tagname, classname)
Are you a web developer? Then VisiBone is for you
Related by category
Lesson learnt with creating DOM element with jQuery
dom tree, tag type, ie 6, jquery
3rd of April 2008
This took me some seriously wasted time to figure out yesterday. What I was trying to do was to create a DOM element of tag type A and insert it into the DOM tree of my page. As I was coding along, everything was working just fine in Firefox but the damn thing wouldn't show up anywhere in IE 6. I debugged and debugged and tried all kinds of different approaches and I just couldn't work it out. Then Karl Rudd gave the right hint on the jQuery mailing list.
Basically, what I was doing was something like this:
$('#toolbar').append(a);
What was then so strange is now less surprising. When I changed the <a> to a <span> it actually worked but just looked wrong with the rest of the site I was working on. Here's the correct way of doing it:
$('#toolbar').append(a);
Notice the difference between <a> and <a></a>. The strange thing is that to reproduce this I created this test.html page but here I noticed that in IE 6 it won't let you add any elements that are enclosing ones that are written as singulars. That's really strange since in the same javascript as the above stuff I did a $("<div>") which was working fine. I'll have to get back to figuring out why that one worked nad the A one didn't.







Save this page in del.icio.us