0
I have a problem with the publishing system.
When I will make a new post and fill in all fields: Title, photo and post the code var myArea2 = document.getElementById('myArea2'); var post = myArea2.innerHTML;
takes all the html element inside the div
with id myArea2
until then it really takes everything, but when I send by ajax
to another php page where it $_POST
it prints the contents of myArea2
for half.
It’s like the ajax
I’ve been sending it in half, it doesn’t go through ALL OVER the content.
function enviarPost() {
var url_s = "<?php print $url_s; ?>";
var myArea2 = document.getElementById('myArea2');
var post = myArea2.innerHTML;
var now_date = document.getElementById('now_date');
var data = now_date.innerHTML;
var now_autor = document.getElementById('now_autor');
var autor = now_autor.innerHTML;
var title = $('#title_post').val();
var result_i = document.getElementById('result_i');
var img = result_i.innerHTML;
if(post != '' || title != '' || img != '') {
var dataString = 'title='+title+'&data='+data+'&autor='+autor+'&img='+img+'&post='+post+'&type=postagem';
$.ajax({
type: "POST",
url: url_s+"server/teste.php",
data: dataString,
cache: false,
success: function(tihidResponse){
$("#sample").html(tihidResponse);
}
});
} else {
alert("Todas as informações tem de estar preenchida: Titulo, imagem e texto de postagem.");
}
}
What should be a complete publication:
Returns only the beginning of the publication, as if it only took the first tag of the content HTML envoy.
Does anyone have any solution??
I tried with type: "GET" by ajax, but it was wrong 414 (Request-URI Too Long)
.
Thanks for the help. I had already done it and it really worked.
– Pedro Quezado