A band-aid for browsers
By Jeremy Keith | March 26th, 2007 | Filed in Browsers, DOM, DOM Scripting TF
Skip to comment formWith tongue firmly in cheek, DOM Scripting Task Force member Dean Edwards says:
Just what the world needs, another JavaScript library.
That hasn’t stopped him from creating Yet Another JavaScript Library Without Documentation™. But this isn’t a big full-featured library along the lines of jQuery or YUI. Instead, this works more along the lines of Dean’s famous IE7 script: it’s a patch for current browsers. For example, it fixes Internet Explorers buggy implentation of getAttribute
and setAttribute
. It also fixes broken browser implementations of the event handling addEventListener
method:
So, as you can see, it doesn’t do much. But what it does, it does consistently across a lot of platforms.
If you’re finding cross-browser DOM Scripting to be a real hassle, this could be just what you need. It creates a level playing field. You won’t get any fancy animations or $ shortcuts but you will get peace of mind for 20K. This probably isn’t a script for beginners but if you’re an advanced developer, you might appreciate the power this gives you.
I don’t think I’d really call this a library. It’s more like a band-aid for browsers. But if you are thinking of putting together your own library or band-aid, Dean has provided rules for JavaScript library authors. In a nutshell, make it small, flexible and standards-based.
Your Replies
- #1 On March 29th, 2007 5:41 am Sebastiaan replied:
-
How about this one for cross-browser scripting: http://www.alistapart.com/articles/crossbrowserscripting
- #2 On April 4th, 2007 1:08 am Abba Bryant replied:
-
The thing that gets me is ( and don’t get me wrong, DE is THE man ) that for around 20k you *can* get the fancy $ shortcut functions, animation and cross browser events – and more – with Jquery.
Having recently looked over the new DE libs and code though, I must say that this is one of the prettiest written libraries out there. It could by itself be used to teach a person javascript as it should be written.
- #3 On April 8th, 2007 6:07 pm Stephan replied:
-
It will be very helpful to freshers, as they needn’t go through the same browser compatibility issues we faced. And since this is standards based, its all the more better.
- #4 On April 15th, 2007 10:22 am Jeff C. replied:
-
How would this effect my website http://www.bandwidtht1.com ? Firefox and IE spit out two different versions.
- #5 On April 29th, 2007 9:56 am parisnajd replied:
-
I have spent too much time trying to learn JavaScript on and off
I haven not seriously tried to use any of the libraries, but they all looked a bit like I’d have to learn a reasonable amount of alternative syntax - #6 On May 6th, 2007 1:42 pm Sebastian replied:
-
I use JavaScript to open a pictures in a new popup window, the problem is, spamers use the same of her shit, so many user deactivat JaveScript…
- #7 On May 11th, 2007 1:18 am Curt replied:
-
JavaScript is my favorite scripting language – easy to create windows, moving text, sounds or other multimedia effects. The new DE libs are very clear and useful.
- #8 On May 17th, 2007 2:55 am Andre replied:
-
“I use JavaScript to open a pictures in a new popup window, the problem is, spamers use the same of her shit, so many user deactivat JaveScript” -> that´s the same problem i have.
- #9 On May 20th, 2007 8:22 pm WaSP Member plauke replied:
-
“I use JavaScript to open a pictures in a new popup window, the problem is, spamers use the same of her shit, so many user deactivat JaveScript”
then code your links so that they also work without javascript, linking to the image when javascript is disabled. graceful degradation…
- #10 On May 24th, 2007 8:04 am Sebastian replied:
-
Many thanks for your answer. Can you show me an example?
- #11 On May 24th, 2007 4:11 pm Daniel replied:
-
“JavaScript is my favorite scripting language – easy to create windows, moving text, sounds or other multimedia effects.”
but many people deactivated it… :( - #12 On May 26th, 2007 10:00 am Romina Miersch replied:
-
I am a PHP programmer who used to do only front end stuff in the time
before managers accepted CSS as a valid way to mark up web pages. ….and I’m a semi-retired software/hardware developer and professional
problem-solver, that now spends available time on making mark up/CSS
work for myself and others – both as a job and as a hobby.Now I’d really like to get up to speed on CSS but everytime I start
to get into it, it seems like, “oh to make that work in that browser
I’ll need this work around, or it’s going to do this or that”.Do you make your pages simple so that there’s flexability in the
design, so that browsers don’t notice the difference? (Think Google)Spending a few hours each month on studying standards and the effect
they have – or doesn’t have – on browsers, is a much more efficient use
of time. - #13 On May 26th, 2007 10:43 am Shannon replied:
-
unfortunately, all gold is not shines, what it would be to revise the JavaScript library too desirably one has no more problems with respect to Cross browser functionality in the daily with that use of browsers.
- #14 On May 30th, 2007 7:06 am Christian replied:
-
A question to Romina: Is it right that Google don’t notice the difference with php? I thought Google prefered always HTML and give them an better position?
- #15 On June 3rd, 2007 2:39 pm Sebastian Kalkbrenner replied:
-
Until JS doesn’t work consistently across browsers, I don’t think it’s worth the hassle at all.
When your page has to be functional without it anyways, I personally can live without fancy eye candy.
Well I know some people can’t. Luckily they aren’t my customers :) - #16 On June 5th, 2007 12:29 pm Andre replied:
-
Having recently looked over the new DE libs and code though, I must say that this is one of the prettiest written libraries out there. It could by itself be used to teach a person javascript as it should be written.
- #17 On June 5th, 2007 3:01 pm Jürgen Harpering replied:
-
Java Script has many advantages. The Websiten can be formed fantastically, many effects ind possibly. Nevertheless, the disadvantage see I in the fact which a lot of user JavaScript have already deactivated because they this leave of the sides hinder.
- #18 On June 9th, 2007 12:16 pm Michael replied:
-
Ask for answer:
HTML could be integrated also in PHP! Why should Google evaluate here differently and then improves positions to assign? - #19 On June 10th, 2007 5:18 am Michael replied:
-
I do not think the fact that Google assigns different positions here since also in PHP seems to HTML and can be integrated.
- #20 On June 10th, 2007 7:19 am Romina Miersch replied:
-
Simplicity is always the best for all solutions, right? Simplicity
comes from understanding complexity. What we provide to our clients
is supposed to be simple, which imposes a great deal of complexity on
us. I’ve always said that the simpler my program is to the client,
the more effort I put into it on my end. Simplicity has it’s price.Oh, you want to earn a living — well that’s different. Just go back
to using tables, turn out crap for the windozes suits, and cash your
checks. If they want an “accepted” css layout, then import a simple
css defining a font. Besides, they won’t know any better anyway.In the meantime, learn. Eventually, you’ll convert over because it is
actually easier to do css than to do it the old table based way. And
in doing so, not only will you knock out better sites, but will do so
with more functionality, shorter development time, less maintenance,
and more accessibility for all. It’s a win-win for all. The big
problem here, as always, is convincing management that they thought
of it first. - #21 On June 11th, 2007 7:25 am Michael replied:
-
The W3C Consortium adopted recommendation regarding HTML4. The new specification brings improvements with forms, Frames and tables. The support of objects, Skripten and Style Sheets is new.
- #22 On June 11th, 2007 9:07 am Rene Ruettgers replied:
-
I‘m a “JavaScript / PHP / ASP / Flash” developer for many “Web application” and “Websites”. I think one of the main Problems for a Webpage is the complex background for all the applications to work together. Like Flash and PHP / JavaScript.
It is easy to work together with the PHP or JavaScript content in the Page and get arguments from Flash to JavaScript or to the other side. The “getAttribute” argument can be set in ActionScript by an easy getURL() command.
So I think this is a god step to operate with other functions of DHTML around all applications used on a Website.
- #23 On June 12th, 2007 6:38 am domain replied:
-
hi,
this JavaScript Library is the best idee since javascript :-)
Thanks for this!But the problem is the most users has javascript deactivated
and so we need a another solution. - #24 On June 12th, 2007 11:37 am Bernhard Heß replied:
-
A real danger does not represent Javascript however, since it gives to these Scriptsprache no instructions to the letter on the non removable disk or other data media. For example form data can be opened for completeness be examined by means of Javascript, small windows (Pop ups) or optimized side navigation. By Javascript InterNet sides become interactive applications, whereby they can be used also for didactical purposes.
- #25 On June 12th, 2007 12:33 pm Adam replied:
-
Cross Browser scripting has become really important in past and you need to waste much time on it.
I think every peace of code that helps us here, even if it does’t do much as Dean says himself, makes life easier and we save time. - #26 On June 13th, 2007 3:10 am Ben Drucker replied:
-
Also I rank myself among this majority. My interest lies not in the handling of a Programiersprache separates in the ability to learn of a technology for the publication of contents on my Website. With HTML4 I can begin already very much. But I am grateful and content.
- #27 On June 14th, 2007 7:14 am Bramka sms darmowa replied:
-
Hello. I use JavaScript to open a pictures in a new popup window, the problem is, spamers use the same of her shit, so many user deactivat JaveScript…
- #28 On June 14th, 2007 10:18 am Rolf Beckmann replied:
-
OK, it depends on the browsers version?
But I use the famous browser Opera.
How do you think of using this browser.
Is there the same problem. Till now I
think Opera is the best browser to test
websites. - #29 On June 15th, 2007 7:36 am Ann Climes replied:
-
Thanks for this really interesting post. It appears really helpful for me. I would like to ask you if I could translate it and include it in our page, also with link to your page. Alternatively I would like to put link to your page on my section with interesting articles. If it would be possible to put this link on my page please email me. One more time thanks for really great article. Greetings
- #30 On June 15th, 2007 10:10 am Andreas Koops replied:
-
This is an interesting discussion. I’m a big friend of “In a nutshell, make it small, flexible and standards-based.” We have always problems to create an consistent code for all browsers. Where ist the next Band-Aid for browsers?
- #31 On June 15th, 2007 8:29 pm Romina Miersch replied:
-
Hallo Mr.Koops… I’ve run into the same thing with marketing agencies who provide web design services. Most I’ve seen tend to concern themselves with how quickly a job can be done and less with the quality of the site altogether, whether in the design or in the code. Many business, whether on the client side or the provider side have a lot to think about when running a business. What I try to get across when talking to people about standards is that it’s really so much simpler than they think, and it can even be much faster than they imagine in the long run to put out the mumbled up messes they were putting out pre-standards.
- #32 On June 16th, 2007 5:58 pm Bernd replied:
-
I’ am just a rookie in Java-script, but it has a lot of options to use it for websites than people know.
- #33 On June 19th, 2007 3:10 pm Erin replied:
-
I agree with Andy, but there is a development to web 2.0 standard. Java is a simple way to solve problems to build websites.
- #34 On June 21st, 2007 5:57 am Rafael replied:
-
Javascript respectively Ajax is an absolute must for the Next-Generation Web Application Development. Anyone should thus enable Javascript. That’s my opinion!
- #35 On June 22nd, 2007 5:41 pm Romina Miersch replied:
-
Hello Rafael, I think Ajax is actually a family of technologies that have been available for years. The means to make requests to the server using only JavaScript were built into Internet Explorer 5.5, but the possibilities of the technology were overlooked. The techniques were rediscovered and used, notably to excellent effect…
This means that when you send a request, you wait for the response to come back, but are free to do other things while you wait. The response probably won’t come back immediately, so you set up a function that will wait for the response to be sent back by the server, and react to it once that happens.
JavaScript is used to make a request to the server. Once the response is returned by the server, you will generally use some more JavaScript to modify the current page’s document object model in some way to show the user that the submission went through successfully.
The data that you receive back from the server will often be packaged up as a snippet of XML, so that it can be easily processed with JavaScript. This data can be anything you want, and as long as you want.
There’s nothing really new about what is happening here. We’re requesting a file (which will often be a server-side script, coded in something like PHP), and receiving a page as the response. This is how the web works already — the only difference is that now we can make these requests from JavaScript.