Posted By

omerta83 on 07/08/10


Tagged

javascript jquery


Versions (?)

Scope namespaces to a specific name or plugin


 / Published in: JavaScript
 

  1. /*
  2. Why namespace? Namespacing ensures that your
  3. variables don't conflict with any others which
  4. happen to have the same name. This is important
  5. if you want to avoid your code breaking when
  6. other files or plugins are included in your
  7. page's architecture. See below for an example of
  8. namespacing data.
  9. */
  10.  
  11. $("div").data("events.plugin",
  12. {
  13. //your data here
  14. });
  15.  

Report this snippet  

You need to login to post a comment.