var luck = $(".textEditor").code();
< /code>
Мой контент на данный момент выглядит следующим образом: < /p>

Tell your travel story...
< /code>
Я делаю следующий запрос Ajax, чтобы отправить его в php < /p>
$.ajax({
dataType : 'json',
async : true,
cache : false,
beforeSend : function(xhr) {
xhr.setRequestHeader("Accept", "application/json");
},
data: {
'luck' : luck
},
type: "POST",
url: "index.php/travelogue/postBlog",
cache: false,
success: function(data, status, xhr) {
alert(data);
},
error:function(xhr, textStatus, errorThrown) {
alert(xhr); alert(xhr.status); alert(textStatus); alert(errorThrown); alert(xhr.statusText); alert(xhr.responseText); }
});
< /code>
На стороне PHP я получаю данные следующим образом (например, я просто помещаю данные в файл txt (< /p>
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
fwrite($myfile, $_POST["luck"]);
fclose($myfile);
< /code>
Но я получаю следующий контент. Из тега в стиле тега IMG отсутствует. < /P>

Tell your travel story...
< /code>
Я не уверен, как правильно извлечь данные? Есть ли проблемы с запросом AJAX или, возможно, я не получаю данные в PHP правильным?>
Подробнее здесь: https://stackoverflow.com/questions/282 ... ax-request
Мобильная версия