jeudi 19 février 2015

Redactor and html special characters


I just set up Redactor wysiwyg. Trying to get autosave working. I have a blank textarea.


<textarea id='editor1'></textarea>


Then I have the follow javascript re: Redactor documentation



$('#editor1').redactor({
autosave: "save.php",
autosaveInterval: 2, // seconds
autosaveCallback: function(name, json)
{
console.log(json.message);
console.log($('#editor1').redactor('code.get'));
}
});


The save.php file just echos back the data, which is console logged as json.message. The data that gets sent with the autosave is encoded somehow, while the data that I get from just using code.get is not.


This is what gets console logged with a simple <p>hello</p>


%253Cp%253E%250A%2509hello%250A%253C%252Fp%253E


I have tried php htmlspecialchars_decode but no change, clearly I am missing something, help?





Aucun commentaire:

Enregistrer un commentaire