Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9270443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:22:17+00:00 2026-06-18T15:22:17+00:00

I’m developping a small web client application using jquery The App at the first

  • 0

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, display data received in a new tab (within the page) and set event handlers via callbacks.

When the user have more than one tab opened, 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 append 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 the tabs opened when the user is browsing on a different page of the site).
I could find 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 ? does it have anything to do with the context ? Or is there a better way to serialize (have been using toJSON from : http://code.google.com/p/jquery-json/ )?

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)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:22:19+00:00Added an answer on June 18, 2026 at 3:22 pm

    to access events handler properties

     var elem = $('#someid')[0];
    
     var data = jQuery.hasData( elem ) && jQuery._data( elem );
    
     console.log(data.events);    //-> {"click":[{"type":"click","origType":"click","data":{"length":1,"0":{"jQuery17207324459496430933":45},"context":{"jQuery17207324459496430933":1,"location":{}},"selector":"#pnl_ctbuilder_1"},"guid":25,"selector":".panel_close a","quick":null,"namespace":""}]}
    

    Accessing functions bound to event handlers with jQuery

    But and that’s the core of the answer : only plain object (no function nor circular reference, no event handlers) are possible to serialize for saving in sessionstore/localstore

    So the magic of detach just won’t happen with webstorage unfortunately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I am using Paperclip to handle profile photo uploads in my app. They upload
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.