Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!feeder3.eweka.nl!81.171.88.15.MISMATCH!eweka.nl!lightspeed.eweka.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <3865616.zCVvmSepPV@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 12 Sep 2012 15:36:52 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 37 NNTP-Posting-Date: 12 Sep 2012 15:36:53 CEST NNTP-Posting-Host: bd94da5f.newsspool3.arcor-online.net X-Trace: DXC=TPEbh?9C4\LAa;:RKVJ>LEMcF=Q^Z^V3H4Fo<]lROoRA8kF Use named access like > alert(window[param]); > > Details: your arrays defined in scope of window. so you can access to them > not only by variable name but as window property by their names Wrong. The correct answer is that variables are properties of the *Global* Object. It can be referred to reliably by `this' in the global execution context: window.alert(this[param]); Referring to variables as properties of the host object referred to by the host-defined `window' property of the Global Object is implementation- dependent and unreliable, because that object may have properties with the same name (it certainly *has* host-defined properties) which can shadow user-defined variables. It is of course a bad idea to rely on several global variables in the first place, and the substring() method is insufficient here. A viable approach would include code like this: var params = (typeof Object.create == "function") ? Object.create(null) : {}; params.all_ = (String(window.location.search).match(/^\??(.*)/) || [, ])[1]; … params.all_ … PointedEars -- When all you know is jQuery, every problem looks $(olvable).