Add HTML Elements to XUL Addons
I've been working on a new addon at Mozilla which isn't anywhere near finished so I wont bother telling you what it's meant to do...because it could change at any moment. Since this is my first real addon, it's been a struggle, but that's a good thing -- it means I'm learning a ton. One problem I ran into was trying to get a checkbox (INPUT
) element within the addon via JavaScript -- nothing was displaying.
After a bit of research and guesswork, I figured out what I was doing wrong -- I was using the wrong document
method to create the element:
var input = document.createElementNS("http://www.w3.org/1999/xhtml", "input");
Using document.createElementNS
with the proper namespace resulted in my checkbox displaying in all of its glory. It's beautiful square, checked glory. Firefox addons can be created in a number of ways so if you're looking to create your own and you aren't seeing HTML elements correctly, keep this solution in mind!
My first professional web development was at a small print shop where I sat in a windowless cubical all day. I suffered that boxed in environment for almost five years before I was able to find a remote job where I worked from home. The first...
Regardless of your stance on pornography, it would be impossible to deny the massive impact the adult website industry has had on pushing the web forward. From pushing the browser's video limits to pushing ads through WebSocket so ad blockers don't detect them, you have...
I was recently visiting MooTools Developer Christoph Pojer's website and noticed a sexy link hover effect: when you hover the link, the the link animates and tilts to the left or the right. To enhance the effect, the background color of the link is...
Once concept I'm very fond of is lazy loading. Lazy loading defers the loading of resources (usually images) until they are needed. Why load stuff you never need if you can prevent it, right? I've created LazyLoad, a customizable MooTools plugin that...
Reminded me of my initial days with JavaScript David! I also made the same namespace errors and then wondered for hours, what went wrong!