Loading ...
Sorry, an error occurred while loading the content.

310Re: Yet Another Global Question...

Expand Messages
  • Douglas Crockford
    Nov 19, 2008
      --- In jslint_com@yahoogroups.com, "santini.alberto" > Usually I use
      the namespace approach or pseudo-block (function () {...});
      >
      > In some cases, for instance, I forget the namespace part and I am not
      > in a pseudo-block, so that function would be global. :(
      >
      > Again I use javascript, server-side with Ajax server Jaxer, and the
      > use of a namespace for the callbacks is not reliable (at the moment
      > and in my context), forcing a global approach.
      >
      > So I was wondering it would be nice a little warning to fix later the
      > code.
      >
      > P.S.: I prefer to use "function foo() {}" instead "var foo = function
      > () {}" because I have not to declare the variable at the start of the
      > function (if you are using onevar option in JSLint).

      I do not understand the benefit of this warning.
    • Show all 6 messages in this topic