Javascript Editor Jqueryte (JQTE)- cannot get modified text in Chrome

535 views Asked by At

I am referring to the Javascript Editor control (jqte) located at http://www.jqueryte.com/. Implementation is simple, but getting the modified text differs between Chrome and Internet Explorer.

This fiddle shows the problem: http://jsfiddle.net/jamescooke/1y29na1p/1/

Script:

$(document).ready(function () {

  $('.jqte-test').jqte();
  $('.jqte-test').jqte({"status" : true});
});

$('#button2').click(function() {
      var editor = $('.jqte-test');
      var newText=editor.text();
      $('#txt').text(newText);

});

Please run it in IE, and you will see the expected modified text.

Then run it in Chrome - and the "modified" text is reported as the original text.

Can anybody make a suggestion?

1

There are 1 answers

0
James Cooke On

Ok I found an answer to this. Before retrieving the edited value, I basically had to disable the query first.

$('#button2').click(function() {
      var editor = $('.jqte-test');
       $('.jqte-test').jqte({"status" : false}); //ADDED THIS LINE
      var newText=editor.text();
      $('#txt').text(newText);
});