webstorage & serialisation of the object returned by the new jquery detach method
===

I'm developping a small web client application using jquery

The App at the first page of session contains only the app menu which trigger ajax requests & callbacks and will display them in a new tab (within the page). 

When the user have more than one tab open, the tab(s) not focused are detached from the dom using $(tab).detach(), the returned object is stored in an array until the tab regain focus (object is then appended back to the DOM). 

The magic of detach is that the object returned contains all the event handlers bind to all the html elements within (so when we append it back we don't have to rebind nothing)

Which is great&fast, except that i cannot manage to serialize that object (and store it to recover it when the user is browsing on a different page of the site).

I could save the html, but the event handlers ... ?

    
    $panels.panel[el]=$("#"+el).detach();
                                    
    alert(itobj($panels.panel[el]));  //->  key: 0 value: [object HTMLDivElement]

    alert($panels.panel[el].html());  //-> return the innerhtml
                                    
    sessionStorage.setItem(el,$.toJSON($panels.panel[el]));
                                    
    alert(sessionStorage.getItem(el));  //-> {"length":1,"0":{},"context":{"jQuery17204145571568968498":1,"location":{}},"selector":"#panelid"}

So how could those event handlers be recovered by the session ?

Any help very appreciated, so thanks a tun (the idea of keeping track of all the callbacks to recall them is highly depressing - & making useless the magic of detach)

