jequery-te get the source and send it using ajax to server side
- I implemented the jquery text editor in my web page.
- I want to get the source and send it to the server side.
- that is what I tried, but it doesn't work.
- it alerts the encoded answer. but it doesnt want to send it to the server.
- if I dont use any editing tool, just simple text. it sends it and I get "ok"
- but if I try to colorize the text or any other editing. the ajax doesnt send it to the server.
- is there a reason?
- $("#postEditor").jqte();
- $('#btnSend').click(function () {
- var answer = encodeURIComponent($(".jqte_editor").html());
- alert(answer);
- var id = $('#msg h3').attr('id').substr(1);
- $.ajax({
- type: "POST",
- url: location.href,
- data: "dt=newAnswer&answer="+answer+"&id="+id
- }).done(function (result) {
- if (result == "ok") {
- alert("ok");
- } else {
- alert("problem");
- }
- });