SHARE
TWEET

Untitled

a guest Oct 23rd, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Creates a namespace.
  3.  *
  4.  * @return
  5.  *   The created namespace object.
  6.  */
  7. function namespace () {
  8.   var a=arguments, o=null, i, j, d;
  9.   for (i=0; i<a.length; i=i+1) {
  10.     d=a[i].split(".");
  11.     o=window;
  12.     for (j=0; j<d.length; j=j+1) {
  13.       o[d[j]]=o[d[j]] || {};
  14.       o=o[d[j]];
  15.     }
  16.   }
  17.   return o;
  18. };
RAW Paste Data
Top