Total Universe Mod
I've been grabbing a lot of scripts lately that each seem use their own flavor of DOM detection/browser sniffing. Since I don't really understand the ins and outs of how to detect and talk to anything I tend to just re-detect inside each function.
Even if I was cool with all that extra code, there's something inherently wrong with writing commands in triplicate.
But it looks like things are calming down and there should be enough protection for old standards if new ones come out.
I've been using the swfobject for about a year now and I'm am still impressed every time I use it. It provides one set of commands that work in all browsers for all things flash. I dare say it's perfect.
So I'm just sitting here wondering, where the hell is the domobject? I wrote a class that creates a Stage object that you can use just like flash's and I'm thinking, this can be done for 100% of available browser elements.
Imagine a js import that simply creates the equivalent of _root in flash and using it, you could refer to your DOM elements just like movieclips and their properties/methods.
There's some great stuff out there like mootools but they are usually prepackaged features, I'm looking for a once and for all, never have to think about cross browsers again fix.
Anyone know of a project like this in development?
However common to most similar libraries it likes you to write code its way, and its way requires a fair bit of typing - lots of YAHOO.util.Whatever.something() stuff everywhere.
For example the get/setAttribute methods are pretty broken in IE. It seems you can just apply the library to your page and it'll take care of making them work properly.
http://dean.edwards.name/weblog/2007/03/yet-another/ has the details.
Total Universe Mod
Those are definitely headed in the right direction.
YUI is out because this demo doesn't work in ie6 (im using a standalone ie6 so I don't know if that is a fair test)
I will have to test a few things out on dean edwards but he's got the right idea.
I want something that just creates an object I can treat like a browser window. Since I'm a huge fan of actionscript, I lean on its naming so lets say the script creates an object called _ROOT. I'd like to be able to just say:
_ROOT.myElement.width = 200px;
without a second thought of weather or not some browser will display that.
So it would actually be two-fold. One part would do all the cross-browser translation, the other would dynamically write the appropriate CSS complete with box model hacks. I would actually prefer to create a style object and set its properties than write CSS anyway.
I would love to just write something like:
myStyle = new JS_STYLE();
myStyle.width = 200px;
myStyle.z-index = 3;
and just not have to worry what browser is going to do what with it. The script should know to insert the appropriate hacks.
Seems like it could be setup so that you could write div elements normally.
Click Here to Expand Forum to Full Width
Poll by Flashkit.com