By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,051 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,051 IT Pros & Developers. It's quick & easy.

JSON uploading stringified html

P: 1
I want to upload a whole user-updated html div, to later download again. This is what I put in the header of the html (it gave no errors, but doesn't upload either):

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  $(document).ready(function(){     document.onbeforeunload = function {    
  3. content = $('#content').html();
  4.   $.post(url, {jsonData: JSON.stringify(content) }, function(response){$('#changelist').text(response);  }); 
  5.    }
  6.   )};
  7.  })
  8. </script>
What am I missing? Thanks!
Jan 25 '16 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,639
url is not defined and the page likely is somewhere else should the AJAX response arrive.
Jan 25 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.