Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
169
rated 0 times [  174] [ 5]  / answers: 1 / hits: 75142  / 13 Years ago, fri, august 5, 2011, 12:00:00

I am using ckeditor to format some data inside my textarea



<textarea id=editorAbout rows=70 cols=80 name=editorAbout></textarea>


Now when i try to post this data using jQuery.ajax like this,



var about=escape( $(#editorAbout).text());
$.ajax({
type: POST,
url: ../Allcammand.aspx?cmd=EditAboutCompany&about=+about,
type:post,
async: false ,
success: function(response){

},
error:function(xhr, ajaxOptions, thrownError){alert(xhr.responseText); }
});


I get the error




HTTP Error 414. The request URL is too long.




I am getting the error here: http://iranfairco.com/example/errorLongUrl.aspx

Try clicking on the Edit Text button at the bottom left of that page.



Why is this happening? How can I solve it?


More From » jquery

 Answers
92

According to this question the maximum practical length of a URL is 2000 characters. This isn't going to be able to hold a massive Wikipedia article like you're trying to send.



Instead of putting the data on the URL you should be putting it in the body of a POST request. You need to add a data value to the object you're passing to the ajax function call. Like this:



function editAbout(){

var about=escape( $(#editorAbout).text());
$.ajax({
url: Allcammand.aspx?cmd=EditAboutCompany&idCompany=+getParam(idCompany),
type:post,
async: false,
data: {
about: about
},
success: function(response){
},
error:function(xhr, ajaxOptions, thrownError){alert(xhr.responseText); ShowMessage(??? ?? ?????? ??????? ????,fail);}
});
}

[#90800] Thursday, August 4, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
katieh

Total Points: 692
Total Questions: 104
Total Answers: 104

Location: Armenia
Member since Sat, Dec 31, 2022
1 Year ago
;