Answer the question
In order to leave comments, you need to log in
jQuery $.getJSON?
Good afternoon.
I pass the value of the textarea field to the php script via $.getJSON
$.getJSON("./ajax/data.php",
{
comment : $("#comment").val()
},
function(data) {
...
});
Answer the question
In order to leave comments, you need to log in
The problem appears due to the limitation of the query string GET request to 512 bytes. It's better to use POST, for example:
$.ajax({
url: './ajax/data.php',
type: 'POST',
data: {comment: $("#comment").val()},
dataType: 'json',
success: function(data) {
//...
}
})
$.post("./ajax/data.php",
{
comment : $("#comment").val()
},
function(data) {
...
},"json");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question