[LRUG] Introduction and a request for JS help

Matthew Westcott matthew.westcott at torchbox.com
Fri Jan 23 08:24:35 PST 2009


On 23 Jan 2009, at 16:12, sole wrote:

> Hi Vahagn,
>
> Just had a little look at your application.js file and compared it to
> the code of a little website of mine (http://mapspam.net). There's
> something that doesn't look right in your file. In the initialize
> function, first line says
>
> if (GBrowserIsCompatible() && typeof gyms != 'undefined') {
>
> I believe it should be
>
> if (GBrowserIsCompatible() && typeof(gyms) != undefined) {
>
> note that now undefined doesn't have the single quotes around.  It's a
> bit like comparing 'nil' and nil ;-)


Hi,
Actually I think the quoted version is correct in this case... the  
typeof operator always returns a string.

- Matt




More information about the Chat mailing list