The below codes get html, encode and send it to any php files. php files include just “hello” string. but when function runs it can get all html but cant send cause of string’s long. Because you cant see the HELLO alert. Ajax allows defined longest? Am I right?
function getlongdata(){
htmldatas=encodeURIComponent($('#divlongcontent').html());
alert(htmldatas);
$.ajax({
type: "GET",
url: "sayhello.php",
data: "longdatago="+htmldatas,
success: function(msg){
alert(msg);
}
});
}
<div id="divlongcontent">blablabla1000000000timesblaaaaaaa</div>
Browsers impose a limit on URL length.
If you are submitting a lot of data, use a POST request and put it in the message body instead of a query string.