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

prototypes vs. function literal

Expand Messages
  • alexmoffat
    Looking at the event.js, connection.js etc. I d like to understand more about why in some cases function literals were used and in others protoype. For
    Message 1 of 1 , Mar 5, 2006
    • 0 Attachment
      Looking at the event.js, connection.js etc. I'd like to understand
      more about why in some cases function literals were used and in others
      protoype. For instance YAHOO.util.Connection is defined using, I
      think, object literal syntax, whereas YAHOO.util.Dom is function
      literal using things like this.getClientHeight = function()....

      I think I understand that in cases like YAHOO.util.Region prototypes
      are used because instances of these objects are going to be created
      and using prototypes will prevent the creation of duplicate member
      function definitions.

      However, can anyone point me to anything that discusses and/or
      explains these issues.

      Thanks
      Alex
    Your message has been successfully submitted and would be delivered to recipients shortly.