473,772 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ajax.response max size

I am using ajax / php where I am looking up some info from the
database and populating a select list dynamically, however I am
running into some sort of size limitation with the ajax.response
object. If the string I am passing to javascript from php is too large
javascript does not get it all the data. The magic number appears to
be 6123 characters, anything below that it works fine, anything above
and if I alert the ajax.response, I see the string is cutoff. Any
ideas where this limitation is defined?

Feb 24 '07 #1
10 4862
tr****@gmail.co m said the following on 2/23/2007 7:48 PM:
I am using ajax / php where I am looking up some info from the
database and populating a select list dynamically, however I am
running into some sort of size limitation with the ajax.response
object. If the string I am passing to javascript from php is too large
javascript does not get it all the data. The magic number appears to
be 6123 characters, anything below that it works fine, anything above
and if I alert the ajax.response, I see the string is cutoff. Any
ideas where this limitation is defined?
Probably implementation independent. But, if you are trying to pass 6K+
of data you are doing something wrong. That is a *lot* of data.
Especially for a select list.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 24 '07 #2
بسم الله الرحمن الرحيم
افضل موقع للتعارف بين الجنس ين الشباب والبنات من كل دول العالم
www.arabzwaj.com

بنات وشباب عايزيين يتعرفوا عليكم
صور عارية حقيقية
تعارف مجاني من كل دول العالم www.arabzwaj.com
for marrige and friend shipافضل تعارف بين الشباب والبنات موقع زواج
مجاني www.arabzwaj.com

www.arabzwaj.com افضل موقع مجاني للتعارف و للزواج الشرعي

www.arabzwaj.com بنات وشباب عايزه تتعرف عليكم

the best web site formarrige and frindship www.arabzwaj.comافضل موقع
مجاني للتعارف و للزواج
Feb 24 '07 #3
بسم الله الرحمن الرحيم
افضل موقع للتعارف بين الجنس ين الشباب والبنات من كل دول العالم
www.arabzwaj.com

بنات وشباب عايزيين يتعرفوا عليكم
صور عارية حقيقية
تعارف مجاني من كل دول العالم www.arabzwaj.com
for marrige and friend shipافضل تعارف بين الشباب والبنات موقع زواج
مجاني www.arabzwaj.com

www.arabzwaj.com افضل موقع مجاني للتعارف و للزواج الشرعي

www.arabzwaj.com بنات وشباب عايزه تتعرف عليكم

the best web site formarrige and frindship www.arabzwaj.comافضل موقع
مجاني للتعارف و للزواج
Feb 24 '07 #4
On 23 Feb 2007 16:48:19 -0800, in comp.lang.javas cript
tr****@gmail.co m
<11************ **********@p10g 2000cwp.googleg roups.comwrote:
>| I am using ajax / php where I am looking up some info from the
| database and populating a select list dynamically, however I am
| running into some sort of size limitation with the ajax.response
| object. If the string I am passing to javascript from php is too large
| javascript does not get it all the data. The magic number appears to
| be 6123 characters, anything below that it works fine, anything above
| and if I alert the ajax.response, I see the string is cutoff. Any
| ideas where this limitation is defined?
Your page:
<select name="lbItems" onChange="AJAXC all(this.value) ;">
<option value="1">1</option>
etc etc etc
</select>

Javascript function on your page
function AJAXCall(val)
{
//--- make your ajaxcall here
url = "mypage.php?id= " + val;
}

php page:
<?php
$id = 0;
if( isset($_GET['id]) ) $id = $_GET['id'];
if( !is_numeric($id ) ) $id =0;

//--- read database
$sql = "SELECT * FROM yourtable WHERE pk=".$id;

//--- loop through recordset and populate listbox
echo "<option value='".$recPK ."'>".$recText. "</option>\n";
?>
---------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Feb 24 '07 #5
I frequently use Ajax requests with responses of 100K+ with no
problems for both IE and FF.
Kris

On Feb 23, 7:14 pm, Jeff North <jnort...@yahoo .com.auwrote:
On 23 Feb 2007 16:48:19 -0800, in comp.lang.javas cript
trp...@gmail.co m

<1172278099.323 577.325...@p10g 2000cwp.googleg roups.comwrote:
| I am using ajax / php where I am looking up some info from the
| database and populating a select list dynamically, however I am
| running into some sort of size limitation with the ajax.response
| object. If the string I am passing to javascript from php is too large
| javascript does not get it all the data. The magic number appears to
| be 6123 characters, anything below that it works fine, anything above
| and if I alert the ajax.response, I see the string is cutoff. Any
| ideas where this limitation is defined?

Your page:
<select name="lbItems" onChange="AJAXC all(this.value) ;">
<option value="1">1</option>
etc etc etc
</select>

Javascript function on your page
function AJAXCall(val)
{
//--- make your ajaxcall here
url = "mypage.php?id= " + val;

}

php page:
<?php
$id = 0;
if( isset($_GET['id]) ) $id = $_GET['id'];
if( !is_numeric($id ) ) $id =0;

//--- read database
$sql = "SELECT * FROM yourtable WHERE pk=".$id;

//--- loop through recordset and populate listbox
echo "<option value='".$recPK ."'>".$recText. "</option>\n";
?>
---------------------------------------------------------------
jnort...@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------

Feb 24 '07 #6
On Feb 24, 7:53 am, "Kris Zyp" <kris...@gmail. comwrote:
I frequently use Ajax requests with responses of 100K+ with no
problems for both IE and FF.
Kris
On a related note: does anybody know how to /post/ more data at the
AJAX call? Normally, any parameters you use are in the URL. But I
would like to be able to post a lot of data to the server... any
idea's?

Paul

Feb 24 '07 #7
On 24 Feb 2007 01:06:22 -0800, in comp.lang.javas cript
"pw******@gmail .com" <pw******@gmail .com>
<11************ **********@j27g 2000cwj.googleg roups.comwrote:
>| On Feb 24, 7:53 am, "Kris Zyp" <kris...@gmail. comwrote:
| I frequently use Ajax requests with responses of 100K+ with no
| problems for both IE and FF.
| Kris
|
| On a related note: does anybody know how to /post/ more data at the
| AJAX call? Normally, any parameters you use are in the URL. But I
| would like to be able to post a lot of data to the server... any
| idea's?
http://ajaxtoolbox.com/request/examples.php

then scroll to Form Submittal.
---------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Feb 24 '07 #8
Ok, Here is the code for what I am doing, and the ajax library being
used is SACK from http://twilightuniverse.com/projects/sack/ I just
can't seem to pass more than about 6100 characters... Any ideas, or a
better way to go?

<?php

//If some search criteria was sent
if(isset($_GET['searchCriteria ']))
{

//////////////////////////////// DB
Connection ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////

include('./adodb/adodb.inc.php') ;

//Type of connection
$db = NewADOConnectio n('oci8');

//Sets the query results to come back as assoc arrays
$db->SetFetchMode(A DODB_FETCH_ASSO C);

//Make the connection
$db->PConnect('xxxx x', 'yyyyy', 'zzzzz');

//////////////////////////////////////////////////////////////////////////////////////////////////////

$rs = $db->Execute("SELEC T DISTINCT ID, NAME FROM PEOPLE WHERE
UPPER(NAME_DISP LAY) LIKE '".$_GET['searchCriteria ']."%'");

$results = null;
while ($arr = $rs->FetchRow()) {
echo "obj.option s[obj.options.len gth] = new
Option('".rawur lencode($arr["NAME"])."','".rawurle ncode($arr["ID"])."');
\n";
}

exit;
}

?>

<link href="style.css " rel="stylesheet " type="text/css" />

<!-- AJAX for processing customer name search -->
<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript">

var ajax = new sack();

function searchInput(inp ut)
{
//Set a variable to hold the value from the form input field
var searchCriteria = input.value;

//Empty results select box
document.getEle mentById('resul t').options.len gth = 0;

//If there is search criteria, then process
if(searchCriter ia.length>0)
{
//Pass to php to process
ajax.requestFil e = 'tst2.php?searc hCriteria='+sea rchCriteria;

//Specify function that will be executed to display results
ajax.onCompleti on = createResults;

//Execute AJAX function
ajax.runAJAX();
}
}

function createResults()
{
var obj = document.getEle mentById('resul t');

//Executing the response from Ajax as Javascript code
//Sent from php as an escaped string so must escape
alert(unescape( ajax.response)) ;
eval(unescape(a jax.response));
}

</script>
<!-- END AJAX for processing customer name search -->
<table>
<tr>
<td><b>Custom er Name:</b></td>
<td>
<input class="cust" id="search" name="search" type="text"
onchange="searc hInput(this)">
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><select multiple size="10" id="result" name="result">

</select>
</td>
</tr>
</table>

Feb 27 '07 #9
On 27 Feb 2007 15:12:53 -0800, in comp.lang.javas cript
tr****@gmail.co m
<11************ *********@k78g2 000cwa.googlegr oups.comwrote:
>| Ok, Here is the code for what I am doing, and the ajax library being
| used is SACK from http://twilightuniverse.com/projects/sack/ I just
| can't seem to pass more than about 6100 characters... Any ideas, or a
| better way to go?
I recommend POSTing your form that way there is virtually no limit on
the input size.
>| <?php
|
| //If some search criteria was sent
| if(isset($_GET['searchCriteria ']))
| {
|
| //////////////////////////////// DB
| Connection ///////////////////////////////////////////////////////
| //////////////////////////////////////////////////////////////////////////////////////////////////////
|
| include('./adodb/adodb.inc.php') ;
|
| //Type of connection
| $db = NewADOConnectio n('oci8');
|
| //Sets the query results to come back as assoc arrays
| $db->SetFetchMode(A DODB_FETCH_ASSO C);
|
| //Make the connection
| $db->PConnect('xxxx x', 'yyyyy', 'zzzzz');
|
|
|
| //////////////////////////////////////////////////////////////////////////////////////////////////////
|
| $rs = $db->Execute("SELEC T DISTINCT ID, NAME FROM PEOPLE WHERE
| UPPER(NAME_DISP LAY) LIKE '".$_GET['searchCriteria ']."%'");
|
| $results = null;
| while ($arr = $rs->FetchRow()) {
| echo "obj.option s[obj.options.len gth] = new
| Option('".rawur lencode($arr["NAME"])."','".rawurle ncode($arr["ID"])."');
| \n";
| }
|
| exit;
| }
|
| ?>
|
| <link href="style.css " rel="stylesheet " type="text/css" />
|
| <!-- AJAX for processing customer name search -->
| <script type="text/javascript" src="ajax.js"></script>
| <script type="text/javascript">
|
| var ajax = new sack();
|
| function searchInput(inp ut)
| {
| //Set a variable to hold the value from the form input field
| var searchCriteria = input.value;
|
| //Empty results select box
| document.getEle mentById('resul t').options.len gth = 0;
|
| //If there is search criteria, then process
| if(searchCriter ia.length>0)
| {
| //Pass to php to process
| ajax.requestFil e = 'tst2.php?searc hCriteria='+sea rchCriteria;
|
| //Specify function that will be executed to display results
| ajax.onCompleti on = createResults;
|
| //Execute AJAX function
| ajax.runAJAX();
| }
| }
|
| function createResults()
| {
| var obj = document.getEle mentById('resul t');
|
| //Executing the response from Ajax as Javascript code
| //Sent from php as an escaped string so must escape
| alert(unescape( ajax.response)) ;
| eval(unescape(a jax.response));
| }
|
| </script>
| <!-- END AJAX for processing customer name search -->
|
|
| <table>
| <tr>
| <td><b>Custom er Name:</b></td>
| <td>
| <input class="cust" id="search" name="search" type="text"
| onchange="searc hInput(this)">
| </td>
| </tr>
| <tr>
| <td>&nbsp;</td>
| <td><select multiple size="10" id="result" name="result">
|
| </select>
| </td>
| </tr>
| </table>
---------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Feb 28 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7474
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole new page that should replace an existing one. I.e when we issue an Ajax request we don't know what will be returned and analyze the response to act accordingly. Now, the way to replace the current document with a new one used to be easy and...
11
9919
by: trpost | last post by:
I am using ajax / php where I am looking up some info from the database and populating a select list dynamically, however I am running into some sort of size limitation with the ajax.response object. If the string I am passing to javascript from php is too large javascript does not get it all the data. The magic number appears to be 6123 characters, anything below that it works fine, anything above and if I alert the ajax.response, I see...
1
2919
by: quill | last post by:
Hi I am making a chatroom script and it appears that the problem seems to be that my setTimeout's are conflicting. The logic is as follows: Run a login check every x seconds Run a trigger check every x seconds
13
2159
by: adam | last post by:
Hey All, I'm relatively new to all this and any help would be appreciated. What I'm aiming to do is create a few requests, to 1. Search for a Student against XML created from the database 2. If more than one student, list all students using DOM 3. Finally, return individual student and enrolments. Heres the code (sorry it's going to be a long one): request.php
0
2466
by: BlipBlip | last post by:
Hi All, I was not sure which forum to post the message to since the problem related to ASP/AJAX, but decided to post it here. I have a simple routine which utilizes an Ajax to query database for keywords presence in database and returns matched records count. Below is the code for 2 pages. First page would take an input, post to the second via ajax and displays the returned message. Everything works fine when I use keywords contained Latin...
0
7191
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along the way. First, deep linking is not something that a completely AJAX web site should be able to do by it's very nature of everything being on one page basically. So how can a person deep link to something that is on one page? This question...
4
1433
by: srkidd12 | last post by:
Hello, I am having problems with using AJAX to call information to my primary ASP page from a secondary asp page that brings in the data I want to display. I'm having the onfocus event trigger the function show() to call in the data from the secondary asp page. However, when I click on the record in the list, nothing happens. The information is suppose to appear ni the div id = "div_id". Please help. I need the information in the...
7
3312
by: Jim in Arizona | last post by:
I'm brand new at ajax. In fact, about 20 minutes ago was the first time I got it to work. The problem I'm having on another page did not work, however. I'm running into the following error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.