Author Archive

ClearField updated to v1.1

Javascript donotfold | 12 Apr. 2010 | no comments

I’ve updated the jQuery plugin: clearField. New in version 1.1 are:

- fixed a couple illogical jQuery plugin things
- added the option to select another attribute than the default “rel” attribute
- added the option to have pre-filled content and still be able to use clearField

This last one is the most significant. If you have used clearField in forms with prefilled content (like for example your name), you might find this update pretty useful. Check out the example below on the plugins’ homepage.

For more info please visit the plugins’ homepage or download it from the jQuery plugins website.

Getting the href value with jQuery in IE

I ran into a ‘bug’ in jQuery that only occurs in IE and under specific circumstances. Actually, it’s not really a bug in jQuery… it’s more a funky “feature” of our beloved* browser: Internet Explorer. (* yeah right, muaha :P )

In jQuery you can easily get the href attribute value off of a link by doing $("mylink").attr("href"); but sometimes in IE this isn’t reliable. For example: normally, if the href value is “#myAnchor”, jQuery will return —surprise, surprise— the string: “#myAnchor”. But in some cases with IE, you’ll get the full URL path of the page you’re currently on, with the anchor string value appended to it (for example: “http://labs.thesedays.com/#myAnchor”).

This bug is specifically annoying when you use the href value in a selector in jQuery. For example, you should never do the following, because it may result in unexpected results when browsing in IE: $("a[href='#myAnchor']").click(...);

Workaround? Instead of using the href attribute, you could use the rel or xref attributes of a link, but these attributes aren’t supposed to be used for this purpose and if you disable javascript, the anchors won’t work anymore.

The  jQuery devs should fix this issue ASAP, because I think that issues like these are the main reason why people use javascript libraries like jQuery: they make hacky javascript work!

For me, this proves once again that Internet Explorer totally fails at DOM management.

These Days for Life, the silent killer site

We didn’t only do an internal auction for Music For Life, we also made a little website where we need your help… to kill a mosquito! Check it out and raise money!

mfl_silent_killer

These Days for Life, the auction

In less than a week we raised €5.247,46 with a talent auction for Music For Life! Check out the other side of the These Days staff: who did what and for how much. Follow @thesedaysBE for updates on footage from each challenge.

Expected highlights: a bucket off water on Myriam, Nuria’s Mexican serenada, Babs’ bellydancing class, Michiels slap-in-the-face-wake-up-call and many more… check it out here.

mfl_auction

jQuery basics

Yesterday I gave a presentation for students of KDG on the basics of jQuery. I didn’t quite know how technical I could go in my presentation so I kept it very basic. The presentation was —hopefully— a good trigger for them to get started with learning jQuery.

jQuery is an awesome tool in these modern times. Point is, javascript has been around since 1995 and although loads of things have happened… not much has changed since then. Using javascript these days is basically the same as 10 years ago. What has changed is the way we use javascript. It’s because of javascript libraries like prototype js that we can all use javascript to the maximum of its abilities without too much hassle.

I started off my presentation with an explanation of the DOM, since I think this is key to understanding how Javascript works. Javascript works with the DOM, not the HTML. And just like javascript works with the DOM, it works with CSS. By just playing around with the DOM and CSS you can do really cool effects. Some examples where I used jQuery to the max are Nokia Comes With Music Launch and the “flappy thingie” on Sistr.it.

Disclaimer: My presentation is more an introduction to jQuery for the students of KDG. There are loads more things that I could talk about like, for example, chaining. If you want to learn more about jQuery I suggest you check out this nice presentation or buy a good jQuery book ;)