I would really like to take all the html in a div (contains many other divs, form elements, etc.), urlencode (maybe), and then make an ajax message to the server side handler so that I can save the exact state of what I see user.
Then I would like to take this line, which I saved in the database, and send it back in response to the ajax call in the future.
Should I use something like the following?
var contents = escape($('#myDiv').html());
Then do the ajax post operation for the server side handler? Would it make sure that I didn't pass any special characters that would ruin the ajax call?
Any pointers are appreciated.
source
share