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

2091Re: [jslint] Re: window

Expand Messages
  • AJ ONeal
    Mar 31, 2011
      That is a nightmare!

      I just noticed that a few days ago and it was really upsetting to see even
      MORE global leakage... YUCK.

      AJ ONeal


      On Thu, Mar 31, 2011 at 6:08 AM, Alexandre Morgaut <morgaut@...>wrote:

      >
      >
      > My biggest nightmare today is that recent browsers like Chrome, IE9, FF4
      > generate a global variable from the id of each HTMLElement of the
      > document...
      >
      > It is know possible in these browser to write
      >
      > domNode = myPanel;
      >
      > or
      >
      > domNode = window.myPanel;
      >
      > instead of
      >
      > domNode = document.getElementById('myPanel');
      >
      > or with jQuery:
      >
      > domNode = $('#myPanel');
      >
      > Let's imagine the effects of existing HTMLElements with id like "location",
      > "document", "event", "toolbar", or even "window"...
      >
      > What should be the list of reserved keywords for valid id value ?
      > All the BOM API ?
      > + APIs like Web Storages, Web Sockets... ?
      > + Global namespaces of common Ajax frameworks ?
      >
      > And what about future HTML5/W3C APIs ?
      > And what about future or private frameworks ???
      >
      > So ... "window.myPanel"
      > -> Bad practice isn't it ?
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Show all 9 messages in this topic