If I attempt to post a string longer than 192 characters (including spaces) with the code below, an error occurs and nothing is submitted. 192 characters plus any amount of whitespace is ok. If the 193rd character is any letter for example, it won't work.
Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://family.localhost/js/jquery-min.js :: anonymous :: line 12" data: no]
1) Is there a limit on string length in a key/value pair?
2) If not, what could cause my error?
3) Any problems with the code below? Suggestions for improvement?
Thanks a lot.Code:$(function() { $("form#new_message").submit(function() { var message = $("#message").get(0); var errorMsg = 'You must type a message before clicking submit'; if ( message.value == '' || message.value == errorMsg ) { message.value = 'You must type a message before clicking submit'; return false; } $.post("/messageboard/postnew" , { message: $("#message").get(0).value } , function(response) { var ajaxResponse = $(response); $("#messages").replaceWith(ajaxResponse.hide().fadeIn(450)); message.value = ''; }); return false; }); });



Reply With Quote
Bookmarks