/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
alert('hi'); return false; /*---------------------------------------------------------------------------*/ /* expandable generic node object */ function Branch(N){var T=this;T.P='[object Tree]';T.N=T.I=T.P;if(N){T.N=N;T.I='window["'+T.N+'"]'}}; Branch.prototype.grow=function(N){ if(!N)return;var T=this;var Tt=T[N]=new Branch(); Tt.N=N; Tt.I=''+T.I+'["'+N+'"]'; Tt.P=T}; Branch.prototype.toString=function(){return this.I}; function /* a convenient preparation of a branch */ Tree(str){return window[str]=new Branch(str)}