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 8048369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:24:41+00:00 2026-06-05T06:24:41+00:00

I copied HTML using .clone(true, true) because I want to keep the JQuery event

  • 0

I copied HTML using .clone(true, true) because I want to keep the JQuery event handlers. When I pass this to PHP via $.post the post fails and gives me the following error in firebug

uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: jquery-1.7.2.js :: <TOP_LEVEL> :: line 7740" data: no]

I want to somehow keep the HTML and its JQuery event handlers because I am working on writing a script to save the state the user is in.

UPDATE (Added Code)

//Save HTML w/ JQuery
GSaveState = new Object();
GSaveState['HTML'] = $('#content').clone(true, true);

$.post("DecoPOState.php", { SavedState: GSaveState},
        function(data){
            alert("Test");
        }
    );
  • 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-05T06:24:44+00:00Added an answer on June 5, 2026 at 6:24 am

    The problem with your code is that you try to send a DOM element – you cannot do that for obvious reasons. Assuming that you want to send the HTML code of that element, use $('#content').html()

    var GSaveState = {
        HTML: $('#content').html();
    };
    

    However, event handlers are not contained in that string since they are attached to the element and not inline event (i.e. they aren’t attributes that appear in the DOM tree).

    To save the application’s state event handlers should not be important at all though. Use variables for the state information you want to save and include them in your POST data.

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

Sidebar

Related Questions

I am using jquery 1.3 , When i clone the element with clone(true) all
I'm using JQuery. I'm writing this as HTML code: <li id=toggle> <a id=open class=open
this is copied from http://www.zenspider.com/ZSS/Products/RubyInline/Readme.html , the home of rubyinline, adding/moding as indicated in
I'm using the a wrapper around the PHP5-class DOMDocument to generate my HTML. This
I'm using the Google Image Search API, and largely copied this code, which builds
This is true for IE 7, 8, and 9. The page http://www.topics2look.com/code-examples/firebug-lite-race-condition/using-remote-firebug-lite-js-file.html loads Firebug
This will blow your mind... Check out http://blue-anvil.com/jquerycurvycorners/test.html using IE Curved corners look nice
I'd like to extract the text from an HTML file using Python. I want
I have this simple project using C#, I copied it from one computer to
I'm using jQuery v1.5.1 and jQuery Cycle v2.99 with the code from this example

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.