Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
31
rated 0 times [  38] [ 7]  / answers: 1 / hits: 19118  / 12 Years ago, fri, march 23, 2012, 12:00:00

Is there a limit to the length of the parameter that be can added to the url for ajax? I am using Thin server on Ruby, and did an ajax request from the web browser in this format:



io=new XMLHttpRequest();
io.open(GET,http://localhost:3000&v=+encodeURIComponent(JSON.stringify(v)),true);


When the length of the string v exceeds about 7000 bytes, it seems to crash. When less, it seems to work. Is my observation right? Where is the restriction coming from? From Thin, Javascript, or the browser? I use Google Chrome browser.


More From » ajax

 Answers
19

Is there a limit to the length of the parameter that can added to the url for ajax?




Yes, if you are using a GET request there's a limit which will depend on the client browser. And this limit has nothing to do with AJAX. IIRC it was around 4K for IE but things might have changed. But in any case there's a limit. If you don't want to be limited you should use POST.


[#86640] Thursday, March 22, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
longd

Total Points: 616
Total Questions: 110
Total Answers: 101

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
;