Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html) is not within the allowed path(s): (/var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/:/usr/lib/php5/:/var/sitesmutu) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 204

Warning: Cannot modify header information - headers already sent by (output started at /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php:204) in /var/www/y/yv/yve/yves.gablin.perso.neuf.fr/public_html/_easy/tech/easy.php on line 261
Javascript
Skip "Manage account"...
Manage account
 

Javascript

This page, for now, is a quick add-on to the site, for sharing scripts I wrote, and I thought could interest my visitors, that is you ;-)

Events management

Modern Javascript makes use of independant objects, and sometimes comes very close to being used as an object-oriented programming language. This makes it easier for programmers to publish object and "classes" that can live together on the same page without conflicting.

All those scripts have a common feature : they get triggered by events, that they had to register on the initialisation phase. Those of you that know the old days of Javascript may remember that events used to be triggered by using special attributes of elements in the page (onclick, onfocus…), unfortunately only one function can be triggered this way for any event ; our modern Javascript objects must all be allowed to use any event !

For this reason, new event models were invented. Those event models are excellently explained on QuirksMode. Due to incompatibilities between browsers, wrapper functions have to be used to add and remove event handlers. Following a couple of links, I soon began to use the well-known Scott Andrew's Javascript event functions.

Unfortunately, it quickly became apparent that those functions have serious shortcomings and bugs in Internet Explorer. Next I discovered the natural companion to the previous article : the addEvent recoding contest.

So I wondered Why not me ? and I decided to create my own version of the wrapper functions. I'm not equiped with the needed software to comply with the Guidelines ; besides, candidates to the contest are not accepted anymore (I learned too late about the contest). Therefore, I wrote my own version just for fun (and learning a lot), and my script is here for you to download. The object is named eventManager, and its features are :

CSS classes management

When you write Javascript code, you often have to test the presence of, or add, or remove CSS classes in the DOM tree. Web authors are (thanksfully) allowed to put multiple classes on a single element. This makes CSS "programming" a lot easier, but Javascript programming a bit harder.

To ease those tasks, you can download the Javascript object I wrote, called cssClassManager, that lets you add, or remove, or replace a class on an element, or simply test the presence of a given class on an element, or even find all elements in the DOM tree that have a given class, starting from a reference element (or the entire document).