jequery-te get the source and send it using ajax to server side

jequery-te get the source and send it using ajax to server side

  1. I implemented the jquery text editor in my web page.
  2. I want to get the source and send it to the server side.
  3. that is what I tried, but it doesn't work.
  4. it alerts the encoded answer. but it doesnt want to send it to the server.
  5. if I dont use any editing tool, just simple text. it sends it and I get "ok"
  6. but if I try to colorize the text or any other editing. the ajax doesnt send it to the server.
  7. is there a reason?

  8. $("#postEditor").jqte();

  9.             $('#btnSend').click(function () {
  10.                 var answer = encodeURIComponent($(".jqte_editor").html());
  11.                 alert(answer);
  12.                 var id = $('#msg h3').attr('id').substr(1);
  13.                 $.ajax({
  14.                     type: "POST",
  15.                     url: location.href,
  16.                     data: "dt=newAnswer&answer="+answer+"&id="+id
  17.                 }).done(function (result) {
  18.                     if (result == "ok") {
  19.                         alert("ok");
  20.                     } else {
  21.                          alert("problem");
  22.                     }

  23.                 });