{Dev Tricks} » Javascript http://dev-tricks.net Blogging developper tips and tricks Sun, 30 Aug 2009 00:14:47 +0000 http://wordpress.org/?v=2.9.2 en hourly 1 Javascript Foncteur http://dev-tricks.net/javascript-foncteur http://dev-tricks.net/javascript-foncteur#comments Thu, 08 May 2008 10:43:30 +0000 Julien Palard http://box.mandark.fr/wordpress/?p=3 I just discovered, this morning, how to create a Visitor in Javascript :
A visitor is an objet who can be used like a function :

Unable to get source code, check your URL given in [viewcode].

Download this code: js_foncteur.js

Implementing it in C++ is extremly easy, using operator overloading, so surcharging the () operator of an object, we have a visitor, but in Javascript, in the current version, we do not have operator overloading.
So we have the following trick :

Unable to get source code, check your URL given in [viewcode].

Download this code: js_foncteur2.js

Enjoy !

]]>
http://dev-tricks.net/javascript-foncteur/feed 1