From: Matteo Nastasi (mop) Date: Tue, 28 May 2013 05:37:58 +0000 (+0200) Subject: enhanced $ function to accept the window handler too X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=afc62c1ffa71669465a91197a21cabd8e4648cef;p=brisk.git enhanced $ function to accept the window handler too --- diff --git a/web/commons.js b/web/commons.js index 7ba8b31..e6b5cb3 100644 --- a/web/commons.js +++ b/web/commons.js @@ -52,9 +52,12 @@ var mlang_commons = { 'imgload_a' : { 'it' : 'Immagine caricate ', 'en' : '(isolation)' } } }; -function $(id) { return document.getElementById(id); } - -function $$(win, id) { return win.document.getElementById(id); } +function $() { + if (arguments.length == 1) + return document.getElementById(arguments[0]); + else + return (arguments[0]).document.getElementById((arguments[1])); +} function dec2hex(d, padding) {