Код: Выделить всё
var luck = $(".textEditor").code();
Код: Выделить всё
[img]http://127.0.0.1/gallery/1/0336dcbab05b9d5ad24f4333c7658a0e.jpeg[/img]
Tell your travel story...
Код: Выделить всё
$.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); }
});
Код: Выделить всё
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
fwrite($myfile, $_POST["luck"]);
fclose($myfile);
Код: Выделить всё
[img]http://127.0.0.1/gallery/1/0336dcbab05b9d5ad24f4333c7658a0e.jpeg[/img]
Tell your travel story...
Любые предложения будут полезны....
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/282 ... ax-request
Мобильная версия