Posts in the "DOMAssistant" Category

ANTABUSE OVER THE COUNTER

ANTABUSE OVER THE COUNTER, Wow. I can't really believe these are my first words of blogging again in almost two months. It always feels a bit funny getting back in the saddle, but once there, I'm as happy as a butterfly on a flower. Cheap ANTABUSE no rx, A picture of a butterfly

At times, it's been a warm summer here in Sweden, and at other times, just endless drizzle... We did have a peak, though, ANTABUSE pictures, with 48 degrees Celsius/118 degrees Fahrenheit. Granted, it was in-the-sun temperature, but still, ANTABUSE OVER THE COUNTER. :-)

A picture of a thermometer showing 48 degrees Celsius/118 degrees Fahrenheit

Family time

With planning, economical as well as any other aspect, I am so so happy that I have managed to stay home the last few summers with my children. ANTABUSE without a prescription, It's time that is truly priceless, and I will continue to do it for as long as I can.

We've been traveling around in Sweden together, having a fantastic time, and my life feels so rich when I am with them.

Computer leave

As usual during my summer leaves, purchase ANTABUSE for sale, I usually try to stay away from the computer as long as possible. ANTABUSE OVER THE COUNTER, Recharge my batteries, if you so will, but mainly there are two reasons.


  1. Working/spending time with the Internet, both professionally and in my spare time, is very rewarding but also very demanding. After ANTABUSE, I need to have a computer break just to get a mental pause, and to keep my burning fire for what is both my mean of income and hobby.

  2. When I have time set aside with my family, I sure don't want to waste it checking e-mails or reading feeds. Family time is family time. Period.

This year I managed to completely stay away from the computer for four weeks (and this includes stowing away the iPhone as well). Felt really good, but it was also an important lesson in how hard everyday tasks (like finding information) becomes when you don't have access to the Internet, ANTABUSE OVER THE COUNTER. Truly something for us to consider: how do we offer options to people, ANTABUSE maximum dosage, and how do we sell it to those not interested (besides stupid statements like "they just don't get it").

What happened on the web/in the IT industry

I think a lot of interesting things took place this summer on the web and in the IT industry. I thought I'd just go through a few of the most interesting ones here, and express my own opinions about them. Order ANTABUSE no prescription,

XHTML 2 got cancelled

By now, I'm sure the entire web development community are aware that XHTML 2 got cancelled, and that one thing that this hopefully will lead to is more focus on HTML 5, helping it to evolve. ANTABUSE OVER THE COUNTER, My personal take is that XHTML 2, while nice and pure in theory, completely fell on not being backwards compatible and, as far as I know, no collaboration with web browser vendors.

If we look at HTML 5, it is backwards compatible, buy ANTABUSE online cod, developers can bring to the table what they already know and last, but definitely not least: web browser vendors have already started implementing it.

What really baffled me, though, ANTABUSE steet value, is the ruckus that came out of this announcement. People started bashing XHTML and its syntax, personal attacks against Jeffrey Zeldman and others for advocating developing with XHTML in books and so on. All-in-all, a lot of bullshit and ignorance, if you ask me, online buy ANTABUSE without a prescription. Here's the deal:


  • HTML 5 can be in HTML format or in XHTML format (i.e, ANTABUSE OVER THE COUNTER. quick closing of tags etc). Basically, the XHTML syntax and sending it as application/xhtml+xml isn't going anywhere. The only thing cancelled was XHTML 2.

  • Jeffrey Zeldman's work spreading knowledge about web standards, ANTABUSE from canada, semantics and proper web development has really helped paving the road for a web with better code. I don't care if his examples were HTML or XHTML - anything that educates people and makes them get better is a good thing in my book, at least.

So, just stop the crap, look into what HTML 5 offers you and move on.

A picture of an angry tiger

Google Chrome OS

Google outed that they're working on a light-weight operating system entitled Google Chrome OS ANTABUSE OVER THE COUNTER, (catchy name...). It will include a new windowing system on top of Linux, ANTABUSE mg. I for one think this is very interesting, and with Windows and Mac OS X in mind, it will be nice with a high-profile operating system being open source (Ubuntu is the only other one I can think of that has gotten some exposure worth talking about).

At this time, Rx free ANTABUSE, there's virtually nothing to see, but I hope it turns out well. Here's to new options.

Mozilla Open Web Tools Directory

Mozilla announced their Open Web Tools Directory, consisting of a collection of open tools for web development, ANTABUSE OVER THE COUNTER. While their main interface is interesting from a technical perspective, I definitely prefer the simple version of the Open Web Tools Directory.

Not sure if it was there from get-go, ANTABUSE schedule, but I was glad to find DOMAssistant to a part of it when I last looked. You can also contact them and submit things you think should be featured there.

Seeing a number of Firebug extensions, I thought they'd gladly accept my pretty popular extensions Firefinder and Inline Code Finder for Firebug, ANTABUSE dosage, so I submitted them as soon as the directory was released - no word and they haven't been added yet, though.

IE 6 supported till 2014

Microsoft have ANTABUSE OVER THE COUNTER, prolonged their IE 6 support four extra years, till 2014. That's the way to go... NOT. Seriously, DROP IE 6 and help people and businesses move forward, buying ANTABUSE online over the counter.

HTML 5 doctor

A nice site with tips, tricks and help for anyone interested in HTML 5 was launched during the summer: HTML5 doctor. It's being run by, amongst other people, my friends Bruce Lawson and Remy Sharp, and I'm sure it will become (and actually, already is) an invaluable resource for development with HTML 5, ANTABUSE OVER THE COUNTER.

Why People Don’t Upgrade Their Browser

The Mozilla Metrics team wrote a very interesting blog post entitled Why People Don’t Upgrade Their Browser – Part I. It is based on the attempt to get people to upgrade from Firefox 2 to Firefox 3 back in May, ANTABUSE duration, and in the prompt that was presented to end users, they got the option to provide feedback.

This feedback is presented in the blog post, and it's a very interesting read. The team then follows up in Why People Don’t Upgrade Their Browser – Part II with how they tried to address the major concerns with the Firefox 3.5 release.

I would love ANTABUSE OVER THE COUNTER, to see such a survey performed on users of other web browsers as well, and then having the results presented completely in the open (one particular web browser especially comes to mind...).

A picture of a couple of Staropramen beer bottles in the sun

The Pirate Bay selling out?

The Pirate Bay has gone through a lot of commotion the last few years, ANTABUSE class, including court visits and fines. In the eye of the public, though, they have always been the underdog, ANTABUSE treatment, the people fighting for the freedom of information. It felt like they were the idealists who would continue forever.

In a surprise move, The Pirate Bay site sold to a game firm in June. This seemed to be widely regarded as selling out, and before the new owner has taken over, their Swedish Internet provider got a court order yesterday to shut them down from Internet - in my opinion, a very scary move in a democratic society, and I could list A LOT of web sites that should be shut down before a torrent tracker; money talks, I guess, and record and movie companies have them.., ANTABUSE OVER THE COUNTER.

Naturally, life pirates always find a way, ordering ANTABUSE online, and currently their web site is up again...

iPhone 3GS

Apple's latest version of the iPhone, iPhone 3GS, started shipping, ANTABUSE dose, and from what I have heard, people are very satisfied with it and its performance. Just one small thing... The name. ANTABUSE OVER THE COUNTER, I mean, the S in the name is supposed to stand for speed: 3G Speed. Is that really all their marketing team could come up with. Bring back Steve Jobs, real brand ANTABUSE online. What will the next version be named. iPhone 3G SS.

Spotify for iPhone

Spotify, the great music service, submitted their iPhone app for approval to be in the App Store, ANTABUSE OVER THE COUNTER. Man, I sure hopes it gets let through. ANTABUSE no rx,

Trying new challenges

During the spring this year, I had a lunch with Joakim Jardenberg In Swedish, who is best described as an entrepreneur who has done a lot of things. We had an interesting talk, and the discussion came into Mindpark In Swedish, which he is now the CEO of, order ANTABUSE online overnight delivery no prescription.

He asked me if I wanted to be part of a blog team for Mindpark, over 20 people, who write posts in Swedish there about a wide range of topics, although mostly focused on media-related things. ANTABUSE OVER THE COUNTER, I said yes, because it seems interesting to reach new, and other sorts of, people and it will be a nice addition to blog a little in my native tounge. Purchase ANTABUSE online no prescription, Maybe it will be great fun, or just something I that didn't suit me. It's good to try, though. For those of you who speak Swedish can read my first post so far: Vad är en upplevelse värd. In Swedish, where can i cheapest ANTABUSE online.

Concerts

I had the please of seeing three concerts during the summer (besides from AC/DC at Ullevi Stadium June 21st 2009 before I stopped blogging):

New York Dolls

My brother called me the day before: "What are you doing tomorrow night?" He'd found out that New York Dolls were playing at a very small club in Stockholm, and asked if I wanted to go, ANTABUSE OVER THE COUNTER. After just a moment of unnecessary hesitation, I said yes.

It was hotter than probably any concert I've been too; when standing completely still, the sweat still poured down from all of my body. Generic ANTABUSE, The gig, though, was really nice, although I can't say I'm a 100% into all of their material. However, their front man David Johansen, buy cheap ANTABUSE, who is a spitting image of Mick Jagger, both visually and voice-wise, really makes it all worth while. ANTABUSE OVER THE COUNTER, All-in-all, a nice evening, and I'm glad I went.

Madonna

For the first time in 19 years, Order ANTABUSE from mexican pharmacy, Madonna decided to play two concerts in Sweden, and being the icon she is, I felt I had to go see her. Fredrika and I went on a road trip down to Gothenburg to see the event.

Overall, I have to say that Madonna's performance was very professional and it was a great show, ANTABUSE from canadian pharmacy. I'm not really a fan of some of her music, but I have to hand it to her that she's indeed very versatile. The problem with something as produced as this show was, though, is that it doesn't really feel personal or unique, ANTABUSE OVER THE COUNTER. Great evening, though. Is ANTABUSE addictive, One thing that got to me is that she didn't play Like a Virgin, which, to me, is one of her most famous songs. But, I guess I just have to add that to the heap with seeing Deep Purple perform without playing Smoke on the Water and Kiss without performing Heaven's on Fire, ANTABUSE trusted pharmacy reviews.

Rhapsody in Rock

I got to see the concert at Skansen with Rhapsody in Rock - Handful of keys 2009. ANTABUSE OVER THE COUNTER, It's basically a concept show with lots of guest artists and performances, all organized by Robert Wells. I've seen Rhapsody in Rock once before, last year, and overall I think it was more even and better planned then. Is ANTABUSE safe, However, this year's event had something fantastic: Glenn Hughes.

When he came on stage, he completely stole the show, with some amazing singing. It was really intriguing to see how he owned the stage, kjøpe ANTABUSE på nett, köpa ANTABUSE online, and everyone's eyes were right at him, all the time. The songs performed with him were outstanding, ANTABUSE OVER THE COUNTER.

It was also an exclusive night with four artists who are very famous in China performing, and it was all filmed by Chinese TV. Where can i buy ANTABUSE online, So, if you're in China and suddenly think you see me sitting in the audience, your eyes aren't playing a trick on you. :-)

Back, back, back, back, back!

My friends, I'm back. I've missed you and writing, and it sure is good to be here again. Please, please say hi. :-).

Similar posts: CIALISPRO OVER THE COUNTER. TEMOVATE FOR SALE. BUY ZYPREXA NO PRESCRIPTION. BACTRIM FOR SALE. AUGMENTIN OVER THE COUNTER. KAMAGRA JELLY FOR SALE. VERMOX OVER THE COUNTER. Buy AMOXICILLIN from mexico. Cheap LEVAQUIN no rx. Buy cheap STRATTERA no rx. Fast shipping RETINA. NEXIUM coupon. MOTILIUM forum. STROMECTOL coupon.
Trackbacks from: ANTABUSE OVER THE COUNTER. ANTABUSE OVER THE COUNTER. ANTABUSE OVER THE COUNTER. ANTABUSE OVER THE COUNTER. ANTABUSE OVER THE COUNTER. ANTABUSE OVER THE COUNTER. ANTABUSE OVER THE COUNTER. Fast shipping ANTABUSE. ANTABUSE canada, mexico, india. Purchase ANTABUSE online no prescription. ANTABUSE price, coupon. ANTABUSE pics. ANTABUSE from mexico. Online buy ANTABUSE without a prescription.

DESYREL FOR SALE

DESYREL FOR SALE, The end of 2008 is near, and I felt it was time to summarize the passed year.

As with every year, lots of things happened, so I've struggled a bit with the things I'd like to mention and which ones I think will follow (or haunt?) us in 2009, buy DESYREL without prescription. Prepare for some very varying topics as well as a link-o-rama. :-)

Interesting events

Google releasing Google Chrome

In september, DESYREL price, coupon, Google outed their contribution to the web browser world: Google Chrome. It has some interesting features with separate processes and very fast rendering, and even though it was officially released in December, I think it still has a far way to go with extensibility, DESYREL over the counter, cross-platform support etc.

A screenshot of Google Chrome

Spotify

In October, one of the most interesting services out there, Spotify, launched and I wrote a little about it
and gave away some invites (and attended a lovely Spotify party), DESYREL FOR SALE. And, Is DESYREL safe, to today's date I've shared a total of about 150 Spotify invites - oh my, ain't I generous. :-)

Anyway, if you get the chance, fast shipping DESYREL, you should really try it out.

Microsoft bidding on Yahoo!

As I'm sure everyone knows, Online buying DESYREL, Microsoft put a bid on Yahoo!, and after that it was a circus with speculations and opinions. Currently, as far as I know, DESYREL class, Yahoo!'s value has sunk far below the initial biddding, and Microsoft claim they're no longer interested. DESYREL FOR SALE, I guess we just have to wait and see... Ordering DESYREL online,

Adobe launched Photoshop online

I must say that I never ever thought Photoshop would be an application available online, and for free at that. But lo and behold, with the launch of Adobe Photoshop Express, DESYREL use, that's just what we got.

Barack Obama

At the time it happened, DESYREL no prescription, I really wanted to write a blog post about Barack Obama being elected. I mean, an eloquent and colored president of the United States. For real, DESYREL FOR SALE. I think I, DESYREL pharmacy, and lots of others with me, still have a problem to fathom what has actually happened. Online buy DESYREL without a prescription, "Stop going on about his color", some people say, but that's just the thing here: he being able to get elected just shows that we finally have passed the line where race doesn't matter anymore, and with the history of US and the slavery, DESYREL wiki, I'm very very happy that this happened. And his victory speech: oh my God, DESYREL results, that's talent.

Everyone keep mentioning at what a tough time he will come to the presidency and how hard it will be, but look at it like this instead: with the state George W. DESYREL FOR SALE, Bush has left the country, whatever Obama does, it can only go uphill, right.

My brother getting married!

In September my kid brother got married, DESYREL gel, ointment, cream, pill, spray, continuous-release, extended-release. Congratulations Martin & Karolina.

A picture of my brother Martin getting married

Happenings, Cheap DESYREL, reflections and change of paths

Some reflections and mentioning a few decisions I made:

Geek Meet

December 4th, Geek Meet had a staggering amount of 150 people attending Geek Meet with Chris Heilmann - I'm really happy and proud to see how the event has taken off.

I also had the opportunity to show Stockholm to Chris and get to know him a little better - I think we had a special moment, but I'll let you judge for yourselves :-) :

A picture of me and Chris

For some unknown reason, australia, uk, us, usa, Tim and Chris got into some groin-touching fixation, so I just helped documenting it... :-)

Leaving DOMAssistant

This year, I decided to leave the DOMAssistant project, DESYREL FOR SALE. Buy cheap DESYREL no rx, It was extremely good and helped me evolve to create and run something like that, but it was time to move on to other challenges, and so far I haven't regretted it.

Number of readers

Since some time during the fall, buy generic DESYREL, I have steadily had over 3000 readers to my RSS feed. As long as the number of followers increase, DESYREL from canadian pharmacy, I must be doing something right, right. :-)

MVB for DZone

In November, I was asked to become an MVB for DZone, DESYREL natural, which I was proud for. DESYREL FOR SALE, Also, getting the possibility to reach out to even more readers should never be overlooked. :-)

Owning an iPhone

After bitching and moaning, About DESYREL, I eventually got an iPhone, and I have to say that it has drastically improved my cell phone/device usage. And when one's past all the flashy fish ponds, guitar and flute playing etc, DESYREL description, it's actually very easy to get dramatically more productive with it.

So yeah, DESYREL alternatives, I love it, although it hasn't improved my sex life (just yet, at least)... :-)

Funny songs

I might be partial here, DESYREL dangers, but I was very satisfied with my song rewrites in Behind Blue Es and A CSS class hero. :-)

Most interesting blog posts

Let's start the link listing frenzy with the posts I think shaped and/or helped me, my development style or opinions, and hopefully made the largest impact with you as well, DESYREL FOR SALE. I strongly recommend reading these, Order DESYREL from mexican pharmacy, and shaping your opinion and takes on these topics:

JavaScript articles

I must say that this year was my most productive in writing JavaScript articles, where can i buy DESYREL online, which would help both me and people struggling with getting the concept of some parts of JavaScript. Here's the list of the most useful ones:

General JavaScript posts

JavaScript inheritance, DESYREL no rx, scope, closures and namespacing

Released code

Looking back at 2008, I was pretty productive in terms of releasing code for you. Here's a list of the most interesting things I brought you:

Firefox extensions

DESYREL FOR SALE, This fall I finally started developing Firefox extensions, and overall it has been a very pleasurable experience (I'll try and write a post about soon). Trying to help myself as well as a lot of other developers out, I put a lot of effort into Inline Code Finder (Inline Code Finder release post), cheap DESYREL no rx, and released it at the end of the year. Available downloads are:

A picture of the Inline Code Finder panel for Firebug

So far, to my happiness, it has been very popular, and I'm proud to see it worthy of being listed amongst other great Firebug extensions

JavaScript badges

Some time during the summer, DESYREL duration, I got into a badge-developing mode, and came up with two useful scripts:

When I develop things for other services, Buy DESYREL online no prescription, it is always interesting to see how they handle that. The nice Tumblr people liked, told me so and kindly listed it amongst the Tumblr Developer Resources. The FriendFeed people, online buy DESYREL without a prescription. Never heard from them.., DESYREL FOR SALE.

JavaScript code

Naturally, I also had a few releases with some good ol' regular JavaScript code as well :-) :

Adobe AIR applications

During spring, I played around with the Adobe AIR framework, and produced a few applications. At the moment, I feel too restrained by some of its shortcomings (perhaps I'll go into that another day), so currently I don't do any further development with it.

The interest in GMDesk, though, has been overwhelming (which also resulted in a visitor record), so I hope people who downloaded it have use for it, and at the same time I feel a bit saddened that I couldn't make it out to be all that I wanted.

People who died in 2008

Perhaps a bit morbid, but I have a strange fascination with knowing which well-known people passed away in the year that went. Some noteworthy names for 2008 are:


  • Heath Ledger

  • Roy Scheider

  • Charlton Heston

  • Isaac Hayes

  • Paul Newman

  • DESYREL FOR SALE, Arthur C. Clarke

  • Eartha Kitt

  • Sir Edmund Hillary

  • Sydney Pollack

  • Yves Saint-Laurent

  • Bo Diddley

  • Michael Crichton

  • Robert Prosky

On a personal level

In the spring of 2008, I lost my grandfather. I would just like to express my sadness for him leaving us, and for anyone else who have lost a loved one - life can be extremely cruel.

Thank you!

Thank you everyone for reading, for being there for me, for helping me out when I constantly harass you. I love writing, and I hope you love reading.

Thank you for 2008 and Happy New Year.

Similar posts: BUY ARMOUR NO PRESCRIPTION. DELTASONE FOR SALE. SEROQUEL OVER THE COUNTER. DIFLUCAN OVER THE COUNTER. ALLOPURINOL FOR SALE. ABILIFY OVER THE COUNTER. PROZAC FOR SALE. Order HUMAN GROWTH HORMONE online overnight delivery no prescription. Online buying IMITREX hcl. FLEXERIL recreational. Where to buy CIALISPRO. Generic COLCHICINE. LEXAPRO steet value. ELAVIL price, coupon.
Trackbacks from: DESYREL FOR SALE. DESYREL FOR SALE. DESYREL FOR SALE. DESYREL FOR SALE. DESYREL FOR SALE. DESYREL FOR SALE. DESYREL FOR SALE. DESYREL street price. DESYREL canada, mexico, india. Herbal DESYREL. DESYREL online cod. DESYREL reviews. DESYREL without prescription. DESYREL pics.

DELTASONE OVER THE COUNTER


Available is also a translation in French of this article DELTASONE OVER THE COUNTER, .

When I review web sites, Where can i cheapest DELTASONE online, and also in my own projects with a number of different team members, I almost constantly stumble across something web developers should really refrain from: inline styling and inline JavaScript code.

What is inline style and inline JavaScript?

Let's begin with explaining what I mean with having CSS and JavaScript inline: it is when you integrate your HTML code directly with either of them, doses DELTASONE work, resulting in having presentation and interaction code spread all throughout the page. DELTASONE for sale, Like this:

<div style="width: 800px; margin: 1em auto; font: bold 1em/1.2 Verdana, Arial, Helvetica, DELTASONE pics, sans-serif">
<div style="float: left; width: 400px; padding: 1em 2em; font-size: 0.9em">
<span id="get-shit" onclick="callSomeFunction()">News</span>
</div>
</div>

What is so bad with it?

Except for not being very pretty code, DELTASONE mg, and hard to get a good overview of it, there are some real disadvantages to this:


HTML file size

Your HTML code will weigh more, i.e, DELTASONE pharmacy. a web page riddled with similar code will have a kb size that is a lot larger than necessary.

Lack of caching

HTML code will never be cached. Contrary to that, external dependencies, such as CSS and JavaScript files, will be cached by the visitor's web browser after the first visit - this means that instead of loading a lot of superfluous HTML code for every page in your web site the visitor visits, it will quickly retrieve all style and interaction locally from the web browser cache.

Poor accessibility

When it comes to inline JavaScript code, such as in the above example, it's applied to an element which doesn't have any built-in fallback interaction handler (i.e., like a link takes you to the URL specified in its href attribute etc), DELTASONE OVER THE COUNTER. Buy DELTASONE no prescription, This means that it won't work when JavaScript, for one reason or the other, isn't available.

Difficult code maintenance

When it comes to making changes to the code, order DELTASONE from mexican pharmacy, I'm sure every web developer would agree on that having code in just one centralized location is a lot more preferable than changing exactly the same kind of code snippets spread all over the files in the web site. DELTASONE dose, Maintaining similar code to the above for an entire web site would be hell.

Doesn't everyone have JavaScript nowadays?

First: no they don't. Second: some people purposely turn it off (for instance, the NoScript Firefox extension has had 31 million downloads to this date), DELTASONE without prescription. Third, Order DELTASONE online overnight delivery no prescription, very often is not up to the end user, but external circumstances that they don't control, which will, where can i find DELTASONE online, to some extent or another, Purchase DELTASONE, lead to JavaScript being unavailable. These factors are:


  • Antivirus programs and firewalls being a bit too harsh in their JavaScript security judgement.

  • DELTASONE OVER THE COUNTER, Company proxy servers filtering out code (for example, read An important lesson learned about AJAX and accessibility).

  • Other company internet access settings preventing proper JavaScript execution.

How you should develop

Any Interface Developer who's fairly skilled knows that he/she should strive for a structure there the content (HTML code) is completely separated from the presentation code (CSS) and interaction code (JavaScript). What this means is that, naturally, DELTASONE online cod, you can't cut the ties completely, Where can i buy cheapest DELTASONE online, but there should be no inline CSS or JavaScript code in your HTML.

The only acceptable dependencies are through id and class attributes for CSS and JavaScript hook-ins.

Taking the above bad example code, is DELTASONE safe, let's rewrite it properly:


<link rel="stylesheet" href="css/base.css" type="text/css" media="screen">
<script type="text/javascript" src="js/base.js"></script>

<div id="container">
<div id="navigation">
<a id="get-news" href="news-proper-url">News</a>
</div>
</div>

/*
CSS code, DELTASONE description, in separate file (base.css)
*/
#container {
width: 800px;
margin: 1em auto:
font: bold 1em/1.2 Verdana, Arial, Helvetica, DELTASONE steet value, sans-serif;
}

#navigation {
float: left;
width: 400px;
padding: 1em 2em;
font-size: 0.9em;
}

/*
JavaScript code, Where to buy DELTASONE, in separate file (base.js)
*/
window.onload = function () {
document.getElementById("get-news").onclick = function () {
// Get news through AJAX
};
}

A bit nicer, isn't it.

When to use id and when to use class

Basically, get DELTASONE, it's very simple. An id is unique for a web page, i.e, DELTASONE OVER THE COUNTER. DELTASONE gel, ointment, cream, pill, spray, continuous-release, extended-release, it should only appear once. The class attribute, on the other hand, DELTASONE maximum dosage, can be in a document as many times as desired. My DELTASONE experience, My rule of thumb is that normally I use the id attribute for larger blocks in a web page, like site container, navigation, buy no prescription DELTASONE online, main content etc. DELTASONE duration, Otherwise, I always use the class attribute. DELTASONE OVER THE COUNTER, When it comes to CSS code, connecting something to anything with that class in the HTML code is very simple. In regards to JavaScript and DOM access, online buying DELTASONE hcl, however, Herbal DELTASONE, native support for that doesn't exist in all web browsers, Therefore I recommend the getElementsByClassName function, which also supports some other nifty features not available in any native web browser implementation, what is DELTASONE.

Event handling in JavaScript

The code in the example is the old DOM Level 1 way of applying events to an element. Kjøpe DELTASONE på nett, köpa DELTASONE online, It works fine for one event per element, but not if you have multiple events you want to apply, or the risk that someone else's code will overwrite your event (or vice versa), DELTASONE overnight.

To avoid having to bother about event handling quirks between web browser implementations (and believe me, After DELTASONE, there are some), I recommend using a JavaScript library like DOMAssistant or jQuery instead.

But what about major players, like Google?

So, by now you have hopefully agreed with all my arguments and is ready to take a plunge into the brave new interface developing world, DELTASONE OVER THE COUNTER. But, taking DELTASONE, just out of curiosity, Order DELTASONE from United States pharmacy, you take a look at the most popular web site in the world, Google, and think:


Wait just a minute now, buying DELTASONE online over the counter. Robert is having me on.


The start page, Cheap DELTASONE, and especially the search results page, is filled with inline styling and JavaScript events. If they do it like that, it has to be the best way, right. Well, no. DELTASONE OVER THE COUNTER, Google has some crazily talented JavaScript coders, as well as geniuses in other fields, but when it comes to HTML and CSS, they are actually somewhat infamous amongst talented Interface Developers.

In August a couple of years ago, my friend Roger rewrote the Google code with real proper code, and he goes more into detail explaining what he did in his post.

At the end, though, we need to consider the ridiculously high amount of visitors Google get every day, and for them it's all about performance, performance, performance (for anyone interested in delving deeper into that, please read Improve your web site performance - tips & tricks to get a good YSlow rating). For them, cutting down any HTTP request is crucial, although that's no excuse for not having valid code.

The most sensible option for Google would be to have one style block located at the top of their HTML code, and one JavaScript block located at the bottom of their HTML code (read more about why in Where to include JavaScript files in a document) and just have id and class attributes to connect that code to.

In the end, though, I really think that the benefit of having the code whatsoever anywhere in the HTML code is negligible, and besides, as soon as we're talking about returning visitors (for instance, I visit Google each and every day), having external includes would be more beneficial and vastly better for performance as well as bandwidth usage, DELTASONE OVER THE COUNTER. Also, in comparison, the Google Mobile page is in a much better state, so having the regular one being so poor does really have any valid motivation - I think it's more of a left behind that hasn't been seen to properly yet (they're probably terrified of changing it).

Conclusion

Therefore, as stated above, make sure to include all your CSS and JavaScript code from external files. Start today. Move all inline code away from the HTML code, and you as well as your team and web site visitors will feel better right away. :-).

Similar posts: BUY QUININE NO PRESCRIPTION. ADVAIR FOR SALE. MEDROL OVER THE COUNTER. TETRACYCLINE OVER THE COUNTER. DESYREL FOR SALE. ZYPREXA OVER THE COUNTER. ARMOUR OVER THE COUNTER. Effects of ARMOUR. Buy cheap SYNTHROID. VALTREX online cod. Comprar en línea CLOMID, comprar CLOMID baratos. VIBRAMYCIN canada, mexico, india. VERMOX from canada. DESYREL gel, ointment, cream, pill, spray, continuous-release, extended-release.
Trackbacks from: DELTASONE OVER THE COUNTER. DELTASONE OVER THE COUNTER. DELTASONE OVER THE COUNTER. DELTASONE OVER THE COUNTER. DELTASONE OVER THE COUNTER. DELTASONE OVER THE COUNTER. DELTASONE OVER THE COUNTER. DELTASONE long term. Buy cheap DELTASONE no rx. DELTASONE overnight. Order DELTASONE from United States pharmacy. DELTASONE wiki. Ordering DELTASONE online. No prescription DELTASONE online.

BUY BUSPAR NO PRESCRIPTION

BUY BUSPAR NO PRESCRIPTION, Currently I'm working a fair bit with JavaScript and teaching different ways to use it, and what I want to talk to you about is if and how you use inheritance in JavaScript. My BUSPAR experience,

The prototype way

The way inheritance works in JavaScript is that it is prototype-, instead of class-based, BUSPAR class. Buy generic BUSPAR, For instance, take a look at this:

function Being () {
this.living = true;
}
Being.prototype.breathes = function () {
return true;
};

An object which inherits Being:

Robert.prototype = new Being;
function Robert () {
this.blogs = true;
}
Robert.prototype.getsBored = function () {
return "You betcha";
};

So, discount BUSPAR, BUSPAR without a prescription, basically, if we create a new instance of the Robert object and call some of its methods, where can i buy BUSPAR online, Purchase BUSPAR online, the result would be:

// Create an instance of the Robert object
var me = new Robert();

/*
Returns "You betcha" as it's a method
belonging to the Robert object
*/
me.getsBored();

/*
Returns true. Since the Robert object
doesn't have a breathes method of
its own, BUSPAR mg, BUSPAR no prescription, it goes back in the
prototype chain to its parent
object, Being, BUSPAR schedule, BUSPAR dose, and finds the
method there
*/
me.breathes();

Calling a parent's method

If you want to call a super method of the method currently being executed, i.e, order BUSPAR from United States pharmacy. What is BUSPAR, if the same method also exists on the parent object, this is how it would have been done the prototype way:

Robert.prototype.getsBored = function () {
/*
Basically, buy generic BUSPAR, BUSPAR alternatives, you need to know the name of
the object and the method name as well.
Then call it in context
*/
Being.prototype.getsBored.call(this);
return "You betcha";
};

Just to point it out, you could also write: this.constructor.prototype.getsBored.call(this);, BUY BUSPAR NO PRESCRIPTION. The reason for this is that this.constructor points to the main constructor of the object, BUSPAR pharmacy, Australia, uk, us, usa, hence the Being object in this case.

Read more about prototype inheritance

For a more thorough explanation, buy BUSPAR without prescription, Where can i cheapest BUSPAR online, read about Prototypes and Inheritance - JavaScript: The Definitive Guide, BUSPAR brand name. BUSPAR results,

People mimicking class-based inheritance

A lot of developers, however, BUSPAR without a prescription, After BUSPAR, come from a class-based inheritance world and either prefer that syntax or just refrain from wanting to use different syntaxes/approaches for different languages. A result of this has been a number of implementations of a more class-based nature in JavaScript, BUSPAR natural, BUSPAR cost, of which these are some of the more well-known ones:

I won't dig into details into these, but the above code would look something like this with John Resig's implementation:

var Being = Class.extend({
living : true, herbal BUSPAR, BUSPAR overnight, breathes : function () {
return true;
}
});

var Robert = Being.extend({
blogs : true,
getsBored : function () {
return "You betcha";
}
});

var me = new Robert();
me.getsBored(); // Returns "You betcha"
me.breathes(); // Returns true

Calling a parent's method, real brand BUSPAR online, BUSPAR duration, super-style

If both the Being object and the Robert object were to have a getsBored method, you'd have the option to call the one belonging to the Being object in a very easy manner:

var Robert = Being.extend({
blogs : true, purchase BUSPAR online, Where can i order BUSPAR without prescription, getsBored : function () {
// This is the syntax to call a super method
this._super();
return "You betcha";
}
});

The way Robert (not the object) swings

I'd thought I'd share my take on the necessity of inheritance overall, and what syntax or solution to use when needed and justified, rx free BUSPAR.

Is there really a huge need for super calls?

BUY BUSPAR NO PRESCRIPTION, First, I'd say that while it's all nice and fine with super method calls, in my experience at least, there have been extremely few, if any, real live cases where I have felt a strong need, a mandatory path to go, with super relations. BUSPAR recreational, And apparently I'm not alone with this opinion. Douglas Crockford states:


I have been writing JavaScript for 8 years now, buy cheap BUSPAR no rx, Cheap BUSPAR, and I have never once found need to use an uber function. The super idea is fairly important in the classical pattern, but it appears to be unnecessary in the prototypal and functional patterns. I now see my early attempts to support the classical model in JavaScript as a mistake.


What syntax to use?

However, for those cases you need some sort of inheritance, what syntax should you use. Personally, I'd say that while I'm somewhat attracted to the class-syntax-like implementations, I prefer using the prototype approach for a number of reasons:


  • It's native, i.e, BUY BUSPAR NO PRESCRIPTION. no dependencies on other code.

  • Freedom of style and version, i.e. if it depended on other code, it would also depend on version of and implementor of that code.

  • Easy readability. I'm sure some of you would want to contradict me, but personally I think the prototype syntax is very easy to look at and understand.

  • Leaving the code to someone else. If you have used a native JavaScript solution, everyone knowing JavaScript will immediately understand it and be able to maintain or extend it. Not the same thing with custom code.

Is there a need for inheritance?

BUY BUSPAR NO PRESCRIPTION, However, I would like to even take it one step further than above. It seems like a number of people overuse inheritance ever so often, ending up in spending most time overriding properties and methods in an object's parent object, than actually using the parent object as an advantage.

For me, I tend to use the Yahoo JavaScript Module Pattern almost all of the time, and I'm quite happy with it. I ported DOMAssistant to it as well, and it's a move I don't regret.

The downside of the pattern is that you can't (not easily, at least), create several instances of the same object. However, the need for this comes very seldom for me, and when it does, I prefer having used a good namespace I can extend (perhaps based on a custom method in the main object), instead of regular, or "true", inheritance, BUY BUSPAR NO PRESCRIPTION. A good example of my approach is How to create a plugin for DOMAssistant.

Embrace and join us!

I would humbly like to ask of you to embrace JavaScript. Don't try to make it into Java, C or any other language. Learn to love it and its dynamic, loose and prototypical nature, and go with the flow. When you stop fighting is when you truly understand how wonderful JavaScript is.

Similar posts: BUY CLOMID NO PRESCRIPTION. QUININE OVER THE COUNTER. VIBRAMYCIN OVER THE COUNTER. MOTILIUM OVER THE COUNTER. BUY CIALISPRO NO PRESCRIPTION. ACOMPLIA OVER THE COUNTER. CIALIS OVER THE COUNTER. TEMOVATE alternatives. Buy ANTABUSE online cod. Purchase ZITHROMAX online. Taking PETCAM. Buy generic ULTRAM. Taking DIFLUCAN. ALDACTONE photos.
Trackbacks from: BUY BUSPAR NO PRESCRIPTION. BUY BUSPAR NO PRESCRIPTION. BUY BUSPAR NO PRESCRIPTION. BUY BUSPAR NO PRESCRIPTION. BUY BUSPAR NO PRESCRIPTION. BUY BUSPAR NO PRESCRIPTION. BUY BUSPAR NO PRESCRIPTION. Canada, mexico, india. BUSPAR pictures. Order BUSPAR online c.o.d. BUSPAR gel, ointment, cream, pill, spray, continuous-release, extended-release. Taking BUSPAR. Buy BUSPAR from mexico. BUSPAR over the counter.

DOMAssistant 2.7.2 released – triggerEvent and replace added

Version 2.7.2 of DOMAssistant has just been released, and beside from some small improvements and minor tweaks, it has two new and very interesting methods.

New methods

The two new methods are:

triggerEvent(evt, target)

The triggerEvent method allows you to trigger an event on an element, like this:

$("news").triggerEvent("click");

$("home-link").triggerEvent("mouseover", elementRef);

Very handy! Also, as pointed out in the release blog post, the event doesn't actually occur, but the event handler is called within the proper context.

replace(content, returnNew)

The replace method allows you to replace an existing element with a new one. The new element can be specified either through an element, string or number reference. For example:

$("container").replace("<div><em>Way</em> cooler content!</div>");

$("container").replace(elementRef, true);

If the second parameter in the method call is set to true, it returns the new element; otherwise, the replace element is returned.

Downloading DOMAssistant 2.7.2

So, what are you waiting for? If you want a JavaScript library with the methods you will actually ever find any use for, mixed together with the fastest performance, go download DOMAssistant 2.7.2 now!

Stepping down with DOMAssistant

January 25th 2007, I released something I fondly nicknamed DOMAss, which step by step evolved into the today full-fledged DOMAssistant. Today, it is time to let it go.

You're doing what?!

Don't worry, the DOMAssistant project isn't being cancelled or something like that. This is merely about me and my part in the project, which is about to change. I'm putting over the decision making and lead of the project to Cheng Hong Lim. I will most likely continue to help out with DOMAssistant, in regards to blogging about it, using it etc, but for now I will not contribute with any more coding.

Why stepping down?

The reasons for me doing this is that I feel I have come to a sort of crossroads. I sincerely think that first I, and then me together with the DOMAssistant team, have accomplished truly great things which I'm indeed is very proud of. However, I feel content with the current place DOMAssistant is in right now, and I've achieved more than ever though possible, both in regards to performance as well as functionality. It's by far the non-work-project I've put the most amount of hours into, and the things I've learned when it comes to JavaScript has probably been unsurpassable, had I taken another route. But, I have a number of ideas and other projects I want to devote my time and hunger to, and the best time to let DOMAssistant go is when it is at a peak, and not in the middle of some development step taking it further.

Setting the bar

Humbly, I would say that I'm pretty convinced we have set the bar for other JavaScript libraries when it comes to certain aspects. First and foremost, to my knowledge, DOMAssistant still has the fastest CSS selectors, and seeing work like John Resig's Sizzle just makes me more convinced that the major JavaScript libraries have taken impression and understand the importance of good performance. DOMAssistant is also the only JavaScript library with complete Unicode support, and in these times and age, definitely being a global world more than ever, I'm sure that the other JavaScript libraries will soon realize that this is vital to be able to offer something on a greater scale. In comparison DOMAssistant also offers complete documentation in Chinese. When will the competitors improve their localization to the biggest Internet market in the world?

The future of DOMAssistant

I am thoroughly convinced that the future of DOMAssistant is bright, and I'm sure Cheng Hong and the others will take it to heights none of you could ever have imagined! :-) Except for the general minor tweaks and improvements, there's some very interesting event work being developed as we speak, and trust me, there's no end to the ideas! Please stay tuned to DOMAssistant, and if you haven't tried it out already, give it a spin! And if you're a developer, feel more than free to look at the code and learn, to give us the chance to make you a better developer, just as people sharing their knowledge to us made us love what we do! Today I step down. Thanks for the ride!

PictureSlides plugin for jQuery – create compelling slideshows and thumbnail galleries

Some time ago I released PictureSlides, a DOMAssistant plugin to create compelling slideshows and thumbnail galleries, with a number of customizable options. Recently, I ported PictureSlides to also work with jQuery, so if you want to do something spiffy with images, I recommend you check it out!

What is PictureSlides?

PictureSlides is a highly customizable JavaScript-based way to easily turn your images into a collection viewable as a slideshow, and with fading effects, if desired. It can be a stand-alone slideshow or have a complete image library look with thumbnails, navigation buttons and whatever you like. It completely respects the already existing HTML in the web page, and creates the functionality from there. This also means that it is very easy to offer an accessible fallback for those without JavaScript enabled. An example image of PictureSlides

How it works

Simply put, PictureSlides consists of one settings file and one core functionality file. This basically means that when an updated version comes along, you can update the functionality file but keep your settings file (unless some new exciting settings are added as well, of course :-) ), to ensure staying up-to-date is as hassle-free as possible. To go into more detail, and find out all the available settings, read more in the PictureSlides implementation instructions.

Demos

Download PictureSlides

If this sounds interesting, please visit the PictureSlides web site, download PictureSlides and try it out! Enjoy! :-)

Summer break

After a spring filled with varying degrees of turmoil, summer is finally here. And with that, my friends, comes my break from development, blogging and any other computer-related activity. The next three months, June, July and August, I'm going to spend full-time with my wonderful daughters Emilia (turning 4 in August) and Filippa (a year and a half old). Except for having the fantastic opportunity to take the time to do such a thing, it is also great for me personally to get some balance and perspective about what's important in life. A picture of Emilia and Filippa

Circumstances

People passing away

Within the first three months this year, two persons I really liked passed away, and with that at the back of my mind, I can see no better way to spend my life than with my loved ones, cherishing life as much as I can.

Work

I don't want to go into details, but certain things at work has made me lose the lust for the moment, hence a break is so very well needed. My hope is that I'll come back more motivated this fall, and that some factors have changed a little. Only time can tell.

Blogging

To be honest, I've been quite pleased with my blogging these last months. Bringing up interesting topics and good discussions, and it just goes to tell how important blogging is to me. Please go through the Archives of all posts to find out more. While I'm happy with almost everyone of them, I'd personally say that, for now, my favorite blog posts and code releases this year are:

Jaded and tired

As most of you know, I've put a lot of work into DOMAssistant. I'll be completely honest and say that that has left me with three general feelings:
  • I'm quite happy with he results we have accomplished!
  • I'm very grateful to have gotten to know such talented and dedicated developers.
  • I am bitter (true honesty now, right?) that if someone like John Resig would have released it, it would've had about 500 000 downloads by now (and no hard feelings about John, he's a true genius and a nice bloke; what I mean here is rather getting the exposure, PR etc).
I've made a couple of comments because of that last bullet, which I don't really like, since I'm normally all about people's free will and being friends with everyone, so turning into a jealous developer is not something I'm proud of. Don't worry. that's gone now, for sure. A picture of Filippa, covering her face My blogging and constructive coding as of lately, though, especially releasing dLite, made me get my passion back in regards to developing because it's FUN! :-)

Being at home

Writing this, I have actually had two weeks at home with the kids already. I've kept on blogging and releasing things, since there were a number of ideas and code I wanted to get off my chest before my leave; and since I refuse to use the computer when anyone else in the family is awake, it has been quite a few long nights as of lately. I am currently the poster boy for sleep deprivation... :-) During these two last weeks I've learned that, when being out on excursions with the daughters, as soon as we say hi to a complete stranger, wave to someone driving by or something similar, the conversation with Emilia (the oldest) almost always goes like this:

- Dad, what's his name?
- I'm sorry honey, I have no idea. - I'll ask mom; she knows.

If mom indeed does know the name of every man stranger where we live, I think mom and I need to have a little talk... ;-)

Learning to say your own name

Filippa's vocabulary has just exploded, and one of the things she's struggling hard to learn is saying her own name. For some time it was just "'pa", but now it has evolved into "pippa". Cute, but the problem is that "pippa" is the Swedish slang for "shag", so it's a bit interesting when she walks up to people, points to herself and says: "PIPPA"... Man, I sure hope that behavior wears off before she becomes a teenager...

Spending time with Fredrika

Fredrika is working full time now, but I do hope that we also get to spend some time together this summer: A picture of Fredrika with a monkey on her shoulder Yes, Fredrika's an amazon, and I'm a monkey. Really.

Till September

Since I won't be publishing any more blog posts during the summer, if you want to reach me, I'll be reading blog comments and e-mail for a couple more days, but after that, consider me unreachable till September. To be sure when I'm back again, please subscribe to my RSS feed. Also, let me appreciate my gratitude to you for reading. You mean a lot to me, really! Read through the Archives if you like my writing style and topics, and also, if you're interested, please try out some of my latest code:

Have a great summer!

Ok, time to stop rambling, and move on to a computer-free living! Have a great summer! A picture of me leaning against a palm tree, drinking out of a coconut

dLite – a lightweight JavaScript library for those who want less features, and more control

Looking at how JavaScript has and its usage has evolved, and also taking in how most JavaScript libraries seem to try to cater for every possible need people might have, I thought it was about time to get back to the basics. To me, that is spelled dLite. There are large projects where using a JavaScript library packed with features is definitely a good thing, both for the web developers and business-wise. However, I'd like to argue that most JavaScript libraries in the state they are today are complete overkill for what people actually need. A lot of developers want one or two functions, and for that, they have to pay the price of including a monolith of over 100 kb, with which they then have to work hard with to minimize, gzip it etc. Another downside with JavaScript libraries is that they have, more or less, completely replaced the native DOM referencing syntax in JavaScript, forcing each developer to read up on the particular library used in their current project. I definitely think that, with an agile mindset, just looking at the code and directly understanding what it does, shouldn't be underestimated.

Analysing peoples' actual needs

A while back John Resig wrote Selectors that People Actually Use, based on some of his research, and overall it goes to prove what I also believe. A majority of web developers don't need a lot of CSS selectors, using inheritance for JavaScript object creation, complete DOM traversing etc. They want something easy and light-weight. I've worked with developing web sites for a long time, and has over the years spoken to numerous web developers who has asked for simplicity and just features they actually need. And, their needs have been exactly the same as mine: element referencing, class name filtering, event handling and a couple more things. Therefore, my strong belief is that what most people need to do when developing JavaScript is:
  • Get a reference to an HTML element.
  • Find out when the DOM has loaded and start working with the document.
  • Find elements with a certain class name.
  • Add and remove events on elements.
  • Add and remove CSS classes on elements.
  • Stop default behavior and cancel bubbling for events.
Those things, and probably in that order too, is what such a large portion of web developers do when they're working with a document.

Creating dLite

A picture of the dLite logo With my conviction that people need less, not more, I set out to create a very small set of JavaScript functions to take care of the above needs, and to make referencing them as easy as possible. The result is dLite (download dLite).

 

The functions in dLite are:
  • elm - find element with a certain id
  • elmsByClass - find elements with a certain class name
  • DOMReady - run functions as soon as the DOM is loaded
  • addClass - add a class name
  • removeClass - remove a class name
  • addEvent - add an event handler
  • removeEvent - remove an event handler
  • stopDefault - prevents the default behavior of an event
  • cancelBubbling - cancels the bubbling of an event

Simple referencing and name assertions

All dLite functions are available in the global scope, meaning you don't need to call them with any objectName.methodName notation, since namespacing in, like, five steps is usually just annoying and tedious for people. If, for any chance, that function name already exists in your document, it will not be over-written by dLite. The functions in dLite are also offered as methods through a dot notation on the dLite object, both as a last resort when the name is already taken in the global scope, and to cater for the web developers who do prefer using a dot notation in their code.

The name of the functions

The idea is that each function has a semantic and self-explanatory name, so any developer looking at the code will understand what it will do. The names are deliberately close to the native DOM methods, to make it easier to adapt to, but at the same time guaranteed to avoid name collision.

Example code

Here are just some example calls of each of the functions in dLite:
elm
var container = elm("container");
elmsByClass
var externalLinks = elmsByClass("external", a);
DOMReady
DOMReady(runAtDOMLoad);
addClass
addClass(elm("container"), "active");
removeClass
removeClass(elm("container"), "active");
addEvent
addEvent(elm("container"), "click", handleClick);
removeEvent
removeEvent(elm("container"), "click", handleClick);
stopDefault
stopDefault(evt);
cancelBubbling
cancelBubbling(evt);

The name

The name dLite is partly meant that it will be a delight using it to develop, partly because some of the functionality is derived from DOMAssistant, so that it, in some sense, is a DOMAssistant light.

dLite's target audience

A while back James Edwards, aka brothercake, wrote You’re Fat and I Hate You where he discusses what he himself thinks is "real developing" and about the need to being able to read the source code, and tweak it to any possible need. I think one of his good points is that a lot of developers write code that do amazing things on the screen, but they have no idea how it works. With dLite, it's the other way around: it is for you anyone who wants to know how, and why, things work, and personally I believe that that is the only way to truly be able to write the most optimized and maintainable code. Therefore, dLite is for JavaScript developers who just want a couple of helper functions to sort out the most common tasks and web browser differences, and then dive in themselves, head-first, into the code and build their own JavaScript worlds. Suffice to say, dLite is for me. Is it for you? :-)

DOMAssistant 2.7.1 released, future plans and asking for help

As most of you are aware of, me and a small group of very talented people are working on our JavaScript library of choice, DOMAssistant, because we have a strong belief that light-weight code, fast and accurate performance, Unicode support and modularity is very important, and crucial for the future state of the web. A little over a month ago, we released the 2.7 version, which included a lot of new features and improvements. However, as with all releases and when something is gaining more and more ground usage, both more features are desired as well as additional tweaks and fixes are need to provide an optimal experience. Therefore, I'm happy to say that we have just updated DOMAssistant to the 2.7.1 release.

What's new?

The new features and small fixes are:
  • Added support for pseudo-classes :nth-last-child, :nth-last-of-type and :target.
  • Added support for single and double quotes around attribute values.
  • Added "noParse" option to .ajax() for disabling the forced conversion of GET-parameters to POST-parameters in a POST-call.
  • Fixed setAttributes method on IE.
  • Fixed xhtml namespace evaluation in XPath.
  • Fixed so addContent accepts a number value as content as well.
  • Fixed so events can be added or removed from an event itself without causing any problem in the event handler.
  • Fixed <object> creation in Firefox.

Downloading the new version

Just download the new version and let us know how it works out for you!

Future DOMAssistant plans

Having achieved great results when it comes to performance, efficiency and Unicode support, the next major step for us is taking a bigger look on how we can make such a vital and important part as event handling more flexible and adaptable. We're talking about custom events, more options for event delegation and other features that we hope will make your life easier.

What we need from you

Naturally, DOMAssistant isn't about getting an opportunity for us team members to pat each others' back and praise each other, but rather offering you the best JavaScript library experience possible. Therefore, we would like to ask you to tell us what you want out of a JavaScript library.

Our questions

  • Do you use a JavaScript library, or do you custom code everything yourself?
  • If you're using JavaScript libraries, do you use just one JavaScript library, or several depending on what's best for the task?
  • Which, if any, JavaScript library do you use today? And why?
  • What features do you deem most important in a JavaScript library?

Plugin development wishes

Another important factor is that we need help from you to develop a community with plugins to DOMAssistant, targeted at the most common uses. If you like DOMAssistant, and have developed functionality on top of it, please consider packaging it and releasing it as a module.

Talk to us

Help us help you. Write a comment here, in the DOMAssistant blog or partake in the DOMAssistant discussion group. You don't have to have an issue or a complete plan to contribute; just speak what comes to your mind, and together I hope we can come up with some great ideas!

How to hide and show initial content, depending on whether JavaScript support is available

Many people ask me how I choose to address an situation where all content in a web should be available without JavaScript, but certain parts hidden if JavaScript is enabled. It's a pretty common scenario where, for instance, part of a tree navigation or different blocks in the web page are hidden for JavaScript-enabled web browsers, thus letting the end user toggle them. However, if the end user doesn't have JavaScript enabled or if it fails for any reason, you would want that toggled content to be visible immediately.

Using noscript?

Just use the noscript element, I guess you're thinking. While that definitely works to some degree, there are some issues with it. To begin with, content within the noscript element will only be visible to user with JavaScript disabled. Not applicable if you want the content visible to everyone, and then having the interaction presentation enhanced with JavaScript. Second, noscript only tells you if JavaScript is enabled or not in the web browser; not if it actually works. There are proxy servers out there cleaning out JavaScript files with what it thinks is inappropriate content, over-zealous antivirus programs, firewalls preventing certain functionality, and so on. In my pragmatic mind, this pretty much renders noscript useless, if you want to be a 100% sure.

Server-side solution?

Not really. You can check USER_AGENT headers and hope for luck, but it's not a guarantee nor offering a consistent way. What you can do is to add some small JavaScript in your web page, which redirects the page or sends a form or XMLHTTPRequest to the server, which in turn stores the value in a cookie or session variable. Then you can reference that on the server-side for consecutive calls. This adds up to extra JavaScript and server-side functionality, which, to me, sounds like making it overly complicated for JavaScript detection.

Hiding of elements

I think the most popular way nowadays is to run JavaScript code at the bottom of a web page, and through a JavaScript library's way to determine if the DOM has finished loading or just by using inline JavaScript code, make a call to hide content which should only be initially visible to the end users with JavaScript disabled. Examples:

The downside

The problem with this approach, however, is that between the point of your HTML that is to be hidden, and the point where your JavaScript library has been completely included and then found the element(s) to hide, there is a possible discrepancy which will result in "jumping" pages; i.e. you will get a flicker temporarily showing the content, and then hiding it. Not acceptable. Looking at the above sample code, this behavior occurs for both DOMAssistant, jQuery and Prototype in, amongst others, web browsers like Internet Explorer 6. The only solution where it doesn't consistently jump is when the code is directly inline, but it does seem to occur the first time that page is loaded in a web browser as well.

A little disclaimer and explanation

The work amongst JavaScript libraries to detect when the DOM has actually loaded is indeed implemented in a solid way. The problem above is the inclusion of the JavaScript file later in the code than the HTML that is to be hidden. If we were to move up the inclusion of the JavaScript file to the top of the document to the head section, no jumping would take place. Without going into the discussion Where To Include JavaScript Files In A Document, the point here is to show how just one extra HTTP request will slow down the perceived rendering. Imagine a more real page where you have image inclusion, other dependencies making their requests, or even horrible ad scripts using document.write creating iframes, who in turn load some external content (a reality for way to many people). With such scenarios, there is no rock solid way to prevent certain content from jumping, no matter how optimized your JavaScript code is to check if the DOM has loaded.

A proposed solution

Working back and forth with this, I was looking for a solution that is completely consistent and reliable, while still offering code separation and caching between pages in a web site. What I came up with, if I may say so myself, is quite simple and clever. :-)

Using JavaScript to include another style sheet

The solution is to include a JavaScript file in the head part of the document. If JavaScript is enabled, it directly runs an anonymous function that in turn creates a link element which only contains CSS code to hide chosen elements if JavaScript is enabled. The way web browsers work, is that JavaScript files has to completely load before any further parsing will take place. This means that when the parsing of the actual content within the body element takes place, your CSS has already been included, hence it's as if the dynamically applied style has always been there. And, the beauty of all this is that by following some of the advice presented in Improve Your Web Site Performance - Tips & Tricks To Get A Good YSlow Rating, is that if you use Expires headers in a proper manner, there will only be one request, site-wide, for your JavaScript and CSS files taking care of your problem. From then on, it reads it directly from your local web browser cache.

The code

I've put together a little demo page to show JavaScript inclusion of a CSS file. Breaking down the code, here are the vital parts: First, include the JavaScript file:
<head>
	<title>Using a script to include a CSS file</title>
	<script type="text/javascript" src="script-styles.js"></script>
</head>
This is the anonymous function running in its own scope, preventing clashes with other variable names. Just change the path to the CSS file to whatever suits you:
(function () {
	var head = document.getElementsByTagName("head")[0];
	if (head) {
		var scriptStyles = document.createElement("link");
		scriptStyles.rel = "stylesheet";
		scriptStyles.type = "text/css";
		scriptStyles.href = "script-styles.css";
		head.appendChild(scriptStyles);
	}
}());
And, lastly, create the script-styles.css file and add the necessary CSS for the version of the web site intended for end users with JavaScript enabled:
#hide-with-script {
	display: none;
}

No more jumping!

With this solution, no matter how many other dependencies of other external files you might have in your web page/site, I hope to have offered you a way to hide extra content for people with JavaScript-enabled web browsers, while offering all of the content to those with JavaScript disabled.

PictureSlides plugin released for DOMAssistant

We have just released a PictureSlides plugin for DOMAssistant, with which you can create picture slideshows, image presentations and also complete picture galleries. Two years ago, I created JaS - JavaScript slides to offer this functionality to people. Since then, it has been widely popular and I got continuous requests about new features. Four things that held me back with JaS was that required every large image to be loaded before the document could be used, it wasn't based on a more solid architecture, it was by default inaccessible without JavaScript (you could create fallbacks, but as well all know, most people don't), and it just wasn't customizable enough. I wanted to improve on this and instead use links, texts, images from the existing HTML code instead, to make it into a much better approach. Naturally, the JavaScript only way is still supported, if you, for instance, want a slideshow to start playing when the web page loads. Another motivating factor was to make it easier to just turn on or off the features people wanted to use, and add things like autoplay at load, looping slideshows, optional preloading of images, separating thumbnail images from large images etc. All the features can now be controlled from a separate settings file, while the core PictureSlides takes care of the functionality itself. Features include:
  • Have slideshows start at page load.
  • Automatically loop slideshows.
  • Use a Lightbox-like feature to dim out the rest of the page during slideshows.
  • Fade ins and fade outs.
  • Optionally preload all the images, to improve end user experience.
  • Programmatically choose what images to start with; for instance, taken from the requesting URL to the page using PictureSlides.
  • Use keyboard shortcut support.
  • Use back and forward navigation links.
  • Presenting a text next to the picture.
  • Use an image counter.

Downloads and demos

But, nothing says it better than you trying out one of the demos, complete with downloadable packages that you can just take and use. The demos are: The source code to download is available through Google code, where you can report any potential issue or just download the latest versions of the files. Try it out and let me know what you think!

Event delegation with JavaScript

There has been a fair share about JavaScript and event delegation, but since a lot of people doesn't seem to have read it, I thought I'd re-iterate the point here. The more the merrier, right? :-)

HTML used for this post

The HTML used for this post, which can also be seen live in the event delegation demo page, looks like this:
<ul id="navigation">
    <li><a href="http://www.robertnyman.com/code-libraries/">Code libraries</a></li>
    <li><a href="http://www.flickr.com/photos/robertnyman">Flickr photos</a></li>
    <li><a href="http://www.robertnyman.com/web-sites/">Web sites</a></li>
    <li><a href="http://www.robertnyman.com/archives/">Archives</a></li>
    <li><a href="http://www.robertnyman.com/geekmeet/">Geek Meet</a></li>
</ul>

Traditional event handling

As we're all taught and how we start out is adding an event to each element we want the end user to be able to interact with; naturally, in an unobtrusive manner (basically, meaning that no events are inline in the HTML code, but rather applied directly from an external JavaScript).
window.onload = function () {
    var navigation = document.getElementById("navigation");
    var navigationLinks = navigation.getElementsByTagName("a");
    for (var i=0; i<navigationLinks.length; i++) {
        navigationLinks[i].onclick = function () {
            /*
                Something extraordinary that
                only you thought of...
            */
        }
    }
};

Why that isn't always so good

The problem with the above approach is that with a web page with a decent level of interaction, it will soon be full of events that the web browser have to keep track of, and it might also pose memory issues in some web browsers (yeah, just guess...). When I met Peter-Paul Koch (ppk) at @media Ajax, one of the questions I asked him is how/if he deals with memory leakage in Internet Explorer. If I remember correctly, he said:

I don't really do much to code around it. Just as long as you're using event delegation, it's practically not a problem.

Presenting event delegation

The general idea with event delegation is to have just one (or a few) events on elements far higher up in the HTML hierarchy, and from there, trace on what target element the event actually occurred, and then take appropriate action. The code from above reworked:
window.onload = function () {
    var navigation = document.getElementById("navigation");
    navigation.onclick = function () {
        // Ta daa!
    }
};
Looks a little bit simpler, right? And it definitely helps to avoid scattering your events all over the place.

But.. Hang on!

"Hey, wait a minute!" I hear you say! "Sure, you only applied one event, but you broke the functionality!", Well, no. The key to succeeding with event delegation is in the function/method receiving the actual event, and from there, decide what to do. Let us take the code above a bit further:
window.onload = function () {
    var navigation = document.getElementById("navigation");
    navigation.onclick = function (evt) {
        // Event tweaks, since IE wants to go its own way...
        var event = evt || window.event;
        var target = event.target || event.srcElement;
        var href = "Link's href: " + target.getAttribute("href") + "\n\n";
        // Completely simplifying below
        var text = "Link's text: " + target.innerHTML;
        alert(href + text);
    }
};
As you might see, the possibilities and advantages of having centralized event handling are probably becoming increasingly clearer to you just as you read this. Your code will be leaner and have better performance, without sacrificing any of the functionality. Ain't that great? :-)

JavaScript library support

As you might have guessed, most JavaScript libraries cater to this in one way or the other. With DOMAssistant, we simply provide a cross-browser way to determine on what actual element the event took place. Same code, but with DOMAssistant:
DOMAssistant.DOMReady(function () {
    $("#navigation").addEvent("click", function (evt) {
        var target = evt.eventTarget;
        // And so on...
    });
});
By the way, if anyone has a suggestion how we can make your event delegation life even easier with DOMAssistant, just let me know!

Event delegation with other JavaScript libraries

Looking around at what other JavaScript libraries offer, I found some quick links to help you out:

Event delegation demos

I've put together a very simple demo page for you to see event delegation in action; there's also an event delegation demo using DOMAssistant. Now, go happy event delegating! :-)

DOMAssistant 2.7 released – better, faster, slimmer + new features!

The new version of DOMAssistant, 2.7, is finally out and my impression is that it is a very stable and solid release. Faster CSS selector performance, new features while at the same time a smaller file size.

New features

Unicode support added

We have added complete Unicode support, to have source documents in basically any language. Take a look at the Slickspeed Unicode test to see how it fares. A little hint: the DOMAssistant column is the one getting it right. :-)

Complete documentation in Chinese

I think it's quite exciting that we can now offer our Chinese-speaking users a complete documentation in Chinese! And if anyone wonders, I have learned that while Cantonese and Mandarin is spoken differently from each other, the written language is the same.

New methods

A number of new useful methods have been added as well:

Vastly improved CSS selector performance

While we already had the overall fastest CSS selector performance with the 2.6 release, we have turned it up a notch; we were also haunted by not being the fastest JavaScript library in Internet Explorer. However, I have to say that the team really rose to the occasion, and now we have the fastest CSS selector performance in IE as well (results may vary... :-) ). Try the Slickspeed test to see the new results!

Fixes

Naturally we have also taken the time to fix or improve already existing functionality. Here's a list of what we've done:
  • Fixed so a function for an event, applied with addEvent, couldn't be added multiple times.
  • Fixed so a function in DOMReady couldn't be applied multiple times.
  • Accuracy fixes for XPath's ends-with() implementation of E[att$=value].
  • Accuracy fixes for nth-child selector.
  • Accuracy fixes for ~ selector and contains in Internet Explorer.
  • Fix for what's allowed following a child/sibling combinator.
  • Fix for attribute selector to support values that contain spaces.
  • Fix for what's returned from the prev and next methods, so it has the correct methods applied.

Try it out!

We think this is a great release, and naturally we think that you should download DOMAssistant and give it a go! Join us in the world DOMination! :-D

Web Developer recommendations: Lim Cheng Hong and Pelle Wessman

Today I though it would be a good time to tell you about two web developers who I would really like to recommend to you: Lim Cheng Hong and Pelle Wessman In Swedish (Pelle's blog). Cheng Hong and Pelle are both members of the DOMAssistant team and have been so for about a month and a half. Initially I asked them to participate because they have very keen eyes when it comes to finding flaws and room for improvement. Since then, I have spoken almost daily with both of them, and they are always there for me, acting extremely humble and professional at the same time. They do things out of such a strong conviction to deliver a great product I'm literally blown away. I don't need to ask them what to do or tell them how to do it; they meet my expectations as soon as I even casually mention a problem or something which can be done better, they jump on it, and then completely exceed what I ever thought would be possible. Now, the three of us, side-by-side, develop DOMAssistant. My initial thought was to be the only one responsible for developing, and just get input from the team, but Cheng Hong and Pelle are outstanding at what they do, so I just had to share coding responsibilities with them. Now when I see what they contribute with, I even feel like yesterday's news sometimes, because they come up with such ingenious solutions to problems I have had a hard time with; it feels like soon I'll be replaced and just become a DOMAssistant evangelist instead (hush, don't tell them... :-) ). Therefore, I would like to say that if you ever get to chance to work with either of them; Cheng Hong resides in Singapore and Pelle in Sweden; act on it and I guarantee you will be more than satisfied with the results! These two are fantastic web developers and I'm convinced they will be part of shaping the future web.

DOMAssistant news – New plugins, TextMate bundle and ten times faster than the competitors in IE 8

A number of exciting things have been going on in the DOMAssistant camp, so I thought I'd fill you in with some of the latest. We're talking plugins, developer tools and taking a glimpse into the future.

Plugin news

AJAXForms plugin

The first plugin has now been released, and it's an AJAXForms plugin. It offers you a way to submit a form completely through AJAX without doing any postbacks of the entire page, and specifying what happens before the form is submitted, and how to handle the response.

DOMEffects

DOMAssistant Team member Pelle has been working hard on creating plugins, and one of the more interesting ones is the DOMEffects plugin. It should appeal to all of you people who have been longing for those eye-candy things such as fades, animations etc. The plugin is still in a beta phase, and Pelle would love to get some feedback about how it works, what syntax to use and so on. Please help him shape the future! :-)

DOMValidator

Not being satisfied with the task of creating DOMEffects, Pelle has also put some time into the DOMValidator plugin, to use with forms to validate user input and such. Same goes here: this one is in a beta phase too, although it has come a bit further than DOMEffects, and any feedback would be greatly appreciated.

TextMate bundle

Team member Roger looked into how developing with DOMAssistant can be made easier and even faster. The result of his work is a DOMAssistant TextMate bundle, and it also works in the Windows alternative E-TextEditor.

Ten times faster in IE 8

As you all probably are aware of, IE 8 beta has been released, and for me, one of the first thing I wanted to test was how well DOMAssistant performed with it. You can imagine my surprise when I saw that DOMAssistant CSS selectors in IE 8 were ten times faster than its nearest competitor! This is only, of course, an indication of what the future might hold, but if the IE team delivers all the way, this might very well become a practical reality after the final release. :-)

DOMAssistant - use it

Naturally, you can see where all this is going; me and the team are very proud and happy with what's happening with DOMAssistant, and we work very hard to create a good alternative for your development needs. So please, try it out and build fantastic things with it! :-)

DOMAssistant lives – version 2.6 released with overall fastest CSS selector performance and plugins

Almost a month ago, I wrote a hesitant post about DOMAssistant in DOMAssistant - Why bother?, so it's about time to talk about that again. At the time, I was feeling generally low and a bit insecure about what I wanted to achieve, and what my priorities were. The response to that post was overwhelming, both in the comments and the people who contacted me through e-mail and instant messaging. Thinking about how it mattered to a lot of people, it also helped me realize that I like what I have achieved with it. I analyzed DOMAssistant and compared it to other JavaScript libraries, and also felt that I really had something to offer. Factors like being lightweight, having very good performance and being flexible inspired me to continue developing DOMAssistant, and make it even better. The last month, I've put a lot of work into it, hence the sparse blogging and mangy parrot state. But the result, I think, is very very good! And don't worry, I wouldn't code something in my free time unless I was completely motivated to do so. Coding things you don't want to, but have to, is referred to as "work", and is a completely different story. :-)

Releasing DOMAssistant 2.6

I've just released DOMAssitant 2.6, and lots of things have changed, and the code is mostly refactored: There are a number of improvements and new goodies in the new 2.6 version, so please check out the release blog post in the DOMAssistant blog.

Credits

I would also like to express my gratitude and thanks to the DOMAssistant Team for helping me out and pushing me to make it even better. I'd like to also direct another thank you to Niklas Lindström for being there for me in the darkest hour of performance issues and mental despair.

DOMAssistant – Why bother?

Maybe I'm just writing this because I've been feeling a bit low lately, but I do wonder if there's any idea that I put any more time into DOMAssistant. Last night we held another Geek Meet here in Stockholm, with a staggering 70 persons or so showing up. Great fun, and I really love meeting so many dedicated souls in real life, and learn from them! However, what came up from two persons working with/for two different large web sites here in Sweden is that they both tried DOMAssistant, and it worked out fine for them, but at the end of the day they needed to have a JavaScript library which was well-known with a large community. This was especially important when we're talking going international with their products. They are both now using jQuery. And previous to them, one of Sweden's most visited web sites removed DOMAssistant, not because they didn't like it, but because other parts/products used Prototype and they needed a consistent approach. And really, I definitely have no hard feelings about this, and completely understand where they're coming from. It's about motivating it to your managers and protecting your investments. Why would they choose a JavaScript library from a local boy, just to be nice? That's not real business sense.

Why I created DOMAssistant

The reasons I started working on DOMAssistant are three-fold:
  • I felt that they JavaScript libraries on the market could be leaner with less bulk.
  • I wanted to give something back to the web development community, and to make people's life easier.
  • I wanted to learn and get better at JavaScript and, consequently, CSS selectors.

Where to go from here

The thing is that I feel I can't compete with DOMAssistant against the other major JavaScript libraries that are out there. It doesn't matter if it's one the smallest libraries available, while having full CSS 1-3 selector support, or if most people who have used it have really liked the functionality, code syntax and feature sets. Where I fall short is in areas like the fact that something like jQuery has one million downloads or so of the latest version and has co-operations like this. I can't compete with that, with maybe 1000 downloads of DOMAssistant. Don't get me wrong, I'm happy that a 1000 people are using it/trying it out, but given the time it takes to maintain it, test it and all the time that I could put into other things (like having a life), I'm just not sure if it's worth it. To be honest, I know of very few people who use DOMAssistant in production, but I'd love to know more about it, to have an actual list of implementations to base my decisions on. But while I've always felt good about offering an alternative, I'm just not sure what price it's worth to pay for just a few people ending up using it.

Is it over now?

I really need some good advice here: what do I need to make DOMAssistant get a much wider user base, and compete with the major players? Or should I just let it go, leave it at its current state; feel content that I could prove to the world that I'm a decent JavaScript developer, and that's it?

DOMAssistant 2.5.6 released – AJAX module post method has been fixed (now 2.5.7 version)

I just released DOMAssistant 2.5.5 yesterday, but with the feedback given, some tweaks had to be made to the new AJAX module post method. Instead of updating the same version multiple times, which is wrong, I've new made a new minor release where the issues have been taken care of. So, download the new 2.5.6 version if you're using DOMAssistant.

Updated January 14th

Just as mentioned by chenghong, I made a mistake and stripped the URL in AJAX GET requests as well. Something I knew, but that's what I get for preaching about assertions but not applying it properly to my own code. I guess my intuition took overhand for a while. ;-)

Anyway, I've released a 2.5.7 version of DOMAssistant now (available for download) where everything should be sorted. If you're using the 2.5.5 or 2.5.6 version, everything should be working fine but the AJAX module's get and post methods, but please update to make sure you have the latest working version.

I sincerely apologize for any inconvenience this might cause you.

DOMAssistant 2.5.5 released, with improved event handling, replaceClass and end methods

I have just released DOMAssistant 2.5.5, which contains some very useful features and improvements, and a CSS selector bug fix.

What's new?

Better event handling

The most major improvements has been optimizing event handling, and making the syntax even easier and understandable. The new features are:

Supporting return false

It is very common to apply events to links and override their default linking behavior. Before you have always had to call the preventDefault method to stop the link from navigating to another page. However, now you can just use return false at the end of your event handling function to stop the default behavior. Example:
$("a.read-more").addEvent("click", readMore);
function readMore(evt) {
	// Do something crazy, like an AJAX call
	return false;
}
Note: this goes for all events on all kinds of element. Links are only used here to exemplify it.

eventTarget for a reference to where the event occurred

If you have, for instance, a navigation menu with lots of links where you want to apply events, it is much simpler and better for performance to apply the event to the parent element to all the links and then reference what element the event actually occurred on to read specific values. This is ok:
// Lots of events applied
$("#navigation a").addEvent("click", handleNavigationClick);
function handleNavigationClick(evt) {
	// The this keyword will refer to the actual link	
	return false;
}
But this is much more optimal:
// Just one event applied
$("#navigation").addEvent("click", handleNavigationClick);
function handleNavigationClick(evt) {
	// The this keyword will refer to the navigation container
	// The eventTarget property will refer to the actual link
	var linkHref = evt.eventTarget.getAttribute("href");
	return false;
}

Easier syntax for preventDefault and cancelBubble

What I want to get away from is having to actually specify the DOMAssistant name in the call when you prevent or cancel the bubbling of events. Now those methods are also made available on every element. Like this:
$("a.read-more").addEvent("click", readMore);
function readMore(evt) {
	// The new easier way
	$(this).preventDefault(evt);
	$(this).cancelBubble(evt);
	
	// The old way, which is still supported
	DOMAssistant.Events.preventDefault(evt);
	DOMAssistant.Events.cancelBubble(evt);
}

replaceClass metod added

A replaceClass has been added, to replace an existing CSS class on an element with another. Example:
$("em.info").replaceClass("active", "hidden");

end method

There are times when you want to select a set of nodes, do some operation on them, and then have the need to return to the previous context. Therefore, the end method has been added for those into chaining syntax:
$("#content").create("p", {
	id: "dynamic-addition"
}, true, "Some dynamic content").end().addClass("content-added");
Let's break that down for you: what happpened was that initially the content element was referred to, then a p element was created and added to the content element, which put the new p as the current context. After that, I wanted to refer the parent content element instead, so I used the end method to go back one step in the chain. This of course works in as many steps as you'd like:
$("#content").create("p", {
	id: "dynamic-addition"
}, true, "Some dynamic content").create("em").end().end().addClass("content-added");

post method added to the AJAX module

I've also implemented a long-requested post method for the AJAX module. Example calls:

$("news").post("news.php?value=true", insertNews);

DOMAssistant.AJAX.post("my-url.aspx?number=10", callbackFunctionName);

What has been fixed?

There was a problem with the :not CSS pseudo-selector for the non-XPath version of DOMAssistant, affecting Internet Explorer and Opera (Opera is planned to utilize XPath when their 9.5 version is released, since it looks promising from beta testing).

AJAX header added

What I forgot to mention when I released DOMAssistant 2.5 is that I added a header to any AHX call being made. It's name is AJAX and the value is "true". Therefore, you distinguish on the server-side if it's a regular request or an AJAX call, and then take the appropriate action (as opposed to having a querystring parameter for each call).

Download!

So, download DOMAssistant and have fun! :-)

Updated January 11th

Due to some problems with the file download, and an initial value needed for the new post method which wasn't present, the download files have now been updated. If you downloaded them before January 11th, make sure to download a new version.

DOMAssistant 2.5 released – CSS selector support, new AJAX methods and more goodies added!

After listening to a number of JavaScript developers, seeing how they work in real life and analyzing their needs, I'm happy to provide the heavily updated DOMAssistant 2.5!

What's new?

First, DOMAssistant is almost completely re-written, to focus on performance, ease-of-use and the most useful features, while trying keep the file size as small as possible. The new major features are:

CSS selector support

Using CSS selectors have almost become a de facto standard in the major JavaScript libraries. Previously I've been a bit hesitant to introduce them, but since everybody loves them and think they are great to use, I have added support for them. And, to be honest, they are a fantastic and easy approach to select element(s), so I'm glad I did! DOMAssistant supports CSS 1, CSS 2 and CSS 3 selectors to get a reference to the specific elements you want, with just a short CSS statement away. And, as opposed to other JavaScript libraries, the syntax for the CSS selectors are exactly the same as specified by W3C. Therefore, you don't have to learn anything extra to use CSS selectors with DOMAssistant, just use the technology you've already adapted. Read the complete list of the different CSS selectors you can now use for more information.

New AJAX methods: load and get

Previously, the only way to make an AJAX call was like this: DOMAssistant.AJAX.get(url, functionToCall). Looking at how most people use AJAX call, and also the need to be in an element's context with the returned content, I've added one new method, and tweaked the existing get method. Now, they can both be used directly on an element.

The load method

The load method will go to the provided URL and then automatically load the returned content into that element. Like this:

$("directions").load("maps.php");

It also provides a second, optional, parameter if the returned content should be appended to the element's already existing content. This defaults to false, i.e. replace the existing content, if not specified:

$("directions").load("maps.php", true);

The get method

The get method works like before, where you call it on the AJAX object and then call a function with the returned content. What's new, though, is that you can also call it directly on an element, and the function called will be within the context of the element that called. Let me show you:

$("news").get("news.php", insertNews);

function insertNews (returnedAJAXContent) {
// The keyword this in this function is the element with an id of "news"
}

Helper methods

There are also a few helper methods to make it easy to track the state of any current requests. These are:
getReadyState
Returns the readyState of the current AJAX request.
getStatus
Returns the status code of the current AJAX request.
getStatusText
Returns the status text accompanying the status code of the current AJAX request.

The elmsByTag method

This method does just what it says: it selects element's by their tag name. This code would select all the a elements which are children to the navigation element:

$("contact-form").elmsByTag("a");

The each method

A feature which has been long requested is to have an each method to easily iterate over all elements returned from an element selection. They way it works is that you call a function for each item in the collection:

$("#navigation a").each(function () {
// Do some JavaScript magic });

What has changed?

DOMAssistant 2.5 is supposed to be completely backwards compatible. That means that if you don't want to use CSS selectors, or you have written a lot of code that's dependent on the previous version, it should work just fine. The nice part about this is that if you like CSS selectors, go crazy with them; if you prefer a more method-based approach for each selection, that will work too. These two code samples do the exact same thing:

$("#contact-form input[type=text]");

$("contact-form").elmsByAttr("type", "text", "input");

Note that if you want to reference an element without the CSS selector approach, its id should not be preceded by a # mark. If you have it there, it will be regarded as a CSS selector. A little tweak of this is that if you only send in one value containing just text to the $ method, it regards it as an element id, and not as a CSS selector. This means that this code will only look for an element with that id, and not elements by that tag name:

$("div");

Frankly, it's a design decision by me that it's usually unlikely that you want, for example, all the div elements in a web page (from a design perspective, very useful; but not as much from a scripting one). Therefore, if you still were to desire all elements of a certain element type within the document, you have these two options:

$("body div");

$(document).elmsByTag("div");

Another difference is that a CSS selector approach will always return an array of elements, and if there's no match, it will return an empty array. This mean that chaining etc will fail silently if there's no match, instead of throwing an error. However, if you do refer to just one element with its id, it will return null if there's no match. This means that you can use different strategies depending on what you want to use it for. Take a look at these two ways to refer to an element, and what they return if it isn't found:

// Returns null
var elm = $("container");
if (elm) // Return false

// Returns an empty array
var elm = $("#container");
if (elm) // returns true

Contrary to these examples, though, I strongly encourage you to use typeof, checking length etc to really make sure something exists and is what you expect it to be, before you try to do any operations on it.

Code quality and performance

I've worked very hard to write as good and consistent code as possible. DOMAssistant now creates its own scope to make use of private properties, and the modules now have the same disposition and structure as the core module. The whole library is JSLint validated, to make sure the code is top-notch and to avoid any runtime errors one might encounter (except for a conditional comment workaround in the Load module to cater to Internet Explorer specific needs). It also introduces a namespacing model, where DOMAssistant is the main object and each module is an extended object related to the core one (DOMAssistant.CSS, DOMAssistant.Events etc). But don't worry whether this will make your life harder; the syntax for the end user is easier than ever, and this is just to ensure code quality behind the scenes. Ease of use and good object structure should not collide with each other.

Performance

Something I find important is to avoid memory leaks in Internet Explorer, for those occurrences when it fails to clean its garbage collection. IE is a very fragile web browser, and it needs to be treated with care. My measure has therefore been to test DOMAssistant together with Drip to make sure no performance is lost, together with making assertions to clean up the code when using innerHTML features to replace already existing code in the document (described more in JScript Memory Leaks). Another inspiration has been Dan Webb's metaprogramming JavaScript, which has inspired me to write self-learning code that will be even faster and smoother to execute!

Utilizing XPath

Most major web browsers, but Internet Explorer, has support for XPath. XPath is a great way to reference elements, and with its native support in web browsers, the speed and cost of performing operations outmatches anything by a regular script. The Opera web browser, unfortunately, has some minor problems in its XPath implementation, so for now it defaults to using the script-based version which IE is using too (these bugs will be reported to Opera in the near future).

My take on JavaScript libraries

The way I see JavaScript libraries is that they should be there for you like a tool belt. At one time or another during they day, you will have a need for each respective tool and it will be there to make your life easier. Most JavaScript libraries out there, though, seem to be more like a storage room: let's fill it with useful things that you might need one day, perhaps. That's not for me. DOMAssistant is completely modular, and all modules together consist of core functionality that I believe everyone needs in their daily JavaScript work:
  • Element selection (through CSS selectors or enhanced methods).
  • CSS handling (adding and removing CSS classes).
  • Event handling (adding and removing events).
  • Content manipulation (add or remove elements).
  • AJAX interaction (getting content from other sources, and adding it to the document).
  • DOM loaded (calling functions when the DOM is loaded, as opposed to the document with all dependencies).
It should be noted that DOMAssistant does in no way alter your CSS through some hidden-away inline styling deep in its core. On the contrary, DOMAssistant wants you to have all your styling in separate CSS files, and use the addClass and removeClass to change the styling of an element. Total separation between presentation and interaction, just the way it should be.

Getting serious

With this release of DOMAssistant, I feel that it can seriously compete with the major JavaScript libraries on the market. It has a very easy syntax to select or manipulate elements, and with the core functionality anyone needs, without having to worry about web browser differences, the compressed version with all modules included weighs in at a mere 6kb (Gzipped). If Gzipping isn't an option for you, the compressed version lands at 21kb.

Bug reporting

From now on, DOMAssistant is hosted by Google code, and with that comes a simple way to report any issue you might encounter, for me to take a look at and quickly fix as soon as possible. It also makes any problems visible to the public, so you can see if it is already being worked on, and at the same time offers all the available downloads for DOMAssistant in one simple interface, where you can go back to a previous release, if you were to encounter any temporary problem with the last released one.

Help me help you!

Please download a copy of DOMAssistant. Play around with it, kick its tires, corner it and try to take its lunch money. See how it reacts to your needs, learn to love the consistent syntax, and, most of all: let it do the dirty work for you so you can focus on the fun parts! Let me know what you think, and don't hesitate to contact me if you have any questions! Happy JavaScripting!

 

Acknowledgements

Thanks to everyone inspiring me and helping me! Extra thanks go out to:

DOMAss – The DOM assistant

Updated March 2nd 2007

DOMAss now has a new name, DOMAssistant, and it is also possible to run it side-by-side with other JavaScript libraries such as Prototype and jQuery. For more information, please read: DOMAss renamed to DOMAssistant, with added Prototype/jQuery compatibility.

Updated March 6th 2007

Per Zimmerman made me aware of the fact that I wasn't as consistent when checking for names and whitespace in the addClass and removeClass as I am in the hasClass method, so this has been fixed to address any potential issues you might have had. Just download the DOMAssistantCSS JavaScript file and you should be good to go. :-)

Updated April 11th 2007

Changed the license to a Creative Commons Deed.

Updated May 11th 2007

Minor fix for strange behavior in IE when using the addEvent method on the window object. For more information, please see DOMAssistant fix for addEvent method peculiarity in IE.

Updated July 11th 2007

PDF documentation added, kindly created by Michael Frühmann.

Updated September 20th 2007

DOMAssistant 2.0 released!

Updated October 4th 2007

The DOMAssistantCompressed JavaScript file has been updated. My compression approach was a little too effective for the special DOMReady fix for Internet Explorer, so necessary code for optimal performance was unfortunately removed. This has now been addressed, so please download the new version if you use the compressed file.

Updated October 19th 2007

The DOMAssistantCompressed JavaScript file is updated again. I noticed a problem with the elmsByAttribute method in IE where the compression resulted in a wrong reference, returning incorrect results. Download the new version and it will be fine.

When I released my EJ code, while I felt that it contained very useful functions, it didn't feel properly packaged. Also, I've always wanted a proper base to stand on for various DOM interaction, so I didn't have to start from scratch in every project. So now, I proudly present DOMAss! DOMAss is short for DOM Assistant, and the idea is to provide a simpler and more consistent way to script against the Document Object Model (DOM) in web browsers. I've always felt that the different ways of accessing elements in the DOM and interact with it isn't always the most logical or practical way, not to mention web browser differences. Being modular and lightweight has also been two very strong demands I've had on the library, so to make sure you only use as little code as possible, as opposed to including large libraries where you, in the end, only use 10% of what's included. The idea with DOMAss is that everything starts with a desired element, and then performs various methods on it, such as adding/removing classes, finding elements with a certain className, applying events to it, etc. Basically, you always select an element using the $ method, and then you will perform actions using customized methods applied to it.

Example code


// Get a direct reference to a DOM element
$("id-of-element");

// Get element's child elements with the class of "mandatory"
$("id-of-element").getElementsByClassName("mandatory");

/* Get element's child elements with a "type" attribute
   that has the value "text"
*/
$("id-of-element").getElementsByAttribute("type", "text");

// Adds the class "selected" to the element
$("id-of-element").addClass("selected");

// Add a onclick event to the element
$("id-of-element").addEvent("click", functionToCall);

It's modular!

The strength with DOMAss is that it is completely modular, in that sense that it is only dependent on one single core JavaScript file, DOMAss.js. That file is only 2.8 kb, and all other modules are optional. Then you can choose to only use the ones you find necessary in your application, and you can easily add your own modules taking advantage of the solid base DOMAss offers. The reasoning behind this is to make the file size usage as small as possible, while at the same time addressing any potential bandwidth issues. The parole is:

Include only what you use.

Different modules are available for various purposes

DOMAss (2.8 kb)
The core module for all DOMAss functionality. This one is required, but all other modules are entirely optional.
DOMAssContent (2.2 kb)
Offers way to create elements, add, remove and replace content in elements.
DOMAssCSS (1.6 kb)
Consists functionality for adding/removing classes from an element, checking if an element has a certain class and to check what rendered style an element has.
DOMAssEvents (1.7 kb)
Offering ways to handle events cross-browser, with the ability of seamlessly adding multiple events to the same element. It also consists of methods to remove added events, preventing default event actions and cancelling the bubbling of events.
DOMAssLoad (1.8 kb)
Gives you a way to call whatever function/-s you want as soon as the DOM has loaded, without the need of waiting for images, flash movies and other external files to load.

Inspirations

Certain people and their scripts has inspired me in the creation of DOMAss, so I thought it would be fair to acknowledge them for the inspiration they've given me:

 

PS. I just have to tell you what my friend Henrik though I should name this post: "The only Ass you'll ever need". :-) DS.