Connecting Tech Pros Worldwide Forums | Help | Site Map

ajax.response max size

trpost@gmail.com
Guest
 
Posts: n/a
#1: Feb 24 '07
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?


Randy Webb
Guest
 
Posts: n/a
#2: Feb 24 '07

re: ajax.response max size


trpost@gmail.com said the following on 2/23/2007 7:48 PM:
Quote:
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.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
=?windows-1256?B?2tHIINLmx8w=?=
Guest
 
Posts: n/a
#3: Feb 24 '07

re: ajax.response max size


بسم الله الرحمن الرحيم


افضل موقع للتعارف بين الجنس ين الشباب والبنات من كل دول العالم
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افضل موقع
مجاني للتعارف و للزواج
=?windows-1256?B?2tHIINLmx8w=?=
Guest
 
Posts: n/a
#4: Feb 24 '07

re: ajax.response max size


بسم الله الرحمن الرحيم


افضل موقع للتعارف بين الجنس ين الشباب والبنات من كل دول العالم
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افضل موقع
مجاني للتعارف و للزواج
Jeff North
Guest
 
Posts: n/a
#5: Feb 24 '07

re: ajax.response max size


On 23 Feb 2007 16:48:19 -0800, in comp.lang.javascript
trpost@gmail.com
<1172278099.323577.325790@p10g2000cwp.googlegroups .comwrote:
Quote:
>| 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="AJAXCall(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";
?>
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Kris Zyp
Guest
 
Posts: n/a
#6: Feb 24 '07

re: ajax.response max size


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:
Quote:
On 23 Feb 2007 16:48:19 -0800, in comp.lang.javascript
trp...@gmail.com
>
<1172278099.323577.325...@p10g2000cwp.googlegroups .comwrote:
Quote:
| 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="AJAXCall(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...@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------

pwiegers@gmail.com
Guest
 
Posts: n/a
#7: Feb 24 '07

re: ajax.response max size


On Feb 24, 7:53 am, "Kris Zyp" <kris...@gmail.comwrote:
Quote:
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

Jeff North
Guest
 
Posts: n/a
#8: Feb 24 '07

re: ajax.response max size


On 24 Feb 2007 01:06:22 -0800, in comp.lang.javascript
"pwiegers@gmail.com" <pwiegers@gmail.com>
<1172307982.118732.108310@j27g2000cwj.googlegroups .comwrote:
Quote:
>| 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.
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
trpost@gmail.com
Guest
 
Posts: n/a
#9: Feb 27 '07

re: ajax.response max size


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 = NewADOConnection('oci8');

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

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



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

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

$results = null;
while ($arr = $rs->FetchRow()) {
echo "obj.options[obj.options.length] = new
Option('".rawurlencode($arr["NAME"])."','".rawurlencode($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(input)
{
//Set a variable to hold the value from the form input field
var searchCriteria = input.value;

//Empty results select box
document.getElementById('result').options.length = 0;

//If there is search criteria, then process
if(searchCriteria.length>0)
{
//Pass to php to process
ajax.requestFile = 'tst2.php?searchCriteria='+searchCriteria;

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

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

function createResults()
{
var obj = document.getElementById('result');

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

</script>
<!-- END AJAX for processing customer name search -->


<table>
<tr>
<td><b>Customer Name:</b></td>
<td>
<input class="cust" id="search" name="search" type="text"
onchange="searchInput(this)">
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><select multiple size="10" id="result" name="result">

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

Jeff North
Guest
 
Posts: n/a
#10: Feb 28 '07

re: ajax.response max size


On 27 Feb 2007 15:12:53 -0800, in comp.lang.javascript
trpost@gmail.com
<1172617973.224488.68470@k78g2000cwa.googlegroups. comwrote:
Quote:
>| 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.
Quote:
>| <?php
>|
>| //If some search criteria was sent
>| if(isset($_GET['searchCriteria']))
>| {
>|
>| //////////////////////////////// DB
>| Connection ///////////////////////////////////////////////////////
>| //////////////////////////////////////////////////////////////////////////////////////////////////////
>|
>| include('./adodb/adodb.inc.php');
>|
>| //Type of connection
>| $db = NewADOConnection('oci8');
>|
>| //Sets the query results to come back as assoc arrays
>| $db->SetFetchMode(ADODB_FETCH_ASSOC);
>|
>| //Make the connection
>| $db->PConnect('xxxxx', 'yyyyy', 'zzzzz');
>|
>|
>|
>| //////////////////////////////////////////////////////////////////////////////////////////////////////
>|
>| $rs = $db->Execute("SELECT DISTINCT ID, NAME FROM PEOPLE WHERE
>| UPPER(NAME_DISPLAY) LIKE '".$_GET['searchCriteria']."%'");
>|
>| $results = null;
>| while ($arr = $rs->FetchRow()) {
>| echo "obj.options[obj.options.length] = new
>| Option('".rawurlencode($arr["NAME"])."','".rawurlencode($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(input)
>| {
>| //Set a variable to hold the value from the form input field
>| var searchCriteria = input.value;
>|
>| //Empty results select box
>| document.getElementById('result').options.length = 0;
>|
>| //If there is search criteria, then process
>| if(searchCriteria.length>0)
>| {
>| //Pass to php to process
>| ajax.requestFile = 'tst2.php?searchCriteria='+searchCriteria;
>|
>| //Specify function that will be executed to display results
>| ajax.onCompletion = createResults;
>|
>| //Execute AJAX function
>| ajax.runAJAX();
>| }
>| }
>|
>| function createResults()
>| {
>| var obj = document.getElementById('result');
>|
>| //Executing the response from Ajax as Javascript code
>| //Sent from php as an escaped string so must escape
>| alert(unescape(ajax.response));
>| eval(unescape(ajax.response));
>| }
>|
>| </script>
>| <!-- END AJAX for processing customer name search -->
>|
>|
>| <table>
>| <tr>
>| <td><b>Customer Name:</b></td>
>| <td>
>| <input class="cust" id="search" name="search" type="text"
>| onchange="searchInput(this)">
>| </td>
>| </tr>
>| <tr>
>| <td>&nbsp;</td>
>| <td><select multiple size="10" id="result" name="result">
>|
>| </select>
>| </td>
>| </tr>
>| </table>
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Satya
Guest
 
Posts: n/a
#11: Feb 28 '07

re: ajax.response max size


On Feb 28, 12:02 am, Jeff North <jnort...@yahoo.com.auwrote:
Quote:
On 27 Feb 2007 15:12:53 -0800, in comp.lang.javascript
trp...@gmail.com
>
<1172617973.224488.68...@k78g2000cwa.googlegroups. comwrote:
Quote:
| Ok, Here is the code for what I am doing, and the ajax library being
| used is SACK fromhttp://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.
>
>
>
Quote:
| <?php
|
| //If some search criteria was sent
| if(isset($_GET['searchCriteria']))
| {
|
| //////////////////////////////// DB
| Connection ///////////////////////////////////////////////////////
| //////////////////////////////////////////////////////////////////////////////////////////////////////
|
| include('./adodb/adodb.inc.php');
|
| //Type of connection
| $db = NewADOConnection('oci8');
|
| //Sets the query results to come back as assoc arrays
| $db->SetFetchMode(ADODB_FETCH_ASSOC);
|
| //Make the connection
| $db->PConnect('xxxxx', 'yyyyy', 'zzzzz');
|
|
|
| //////////////////////////////////////////////////////////////////////////////////////////////////////
|
| $rs = $db->Execute("SELECT DISTINCT ID, NAME FROM PEOPLE WHERE
| UPPER(NAME_DISPLAY) LIKE '".$_GET['searchCriteria']."%'");
|
| $results = null;
| while ($arr = $rs->FetchRow()) {
| echo "obj.options[obj.options.length] = new
| Option('".rawurlencode($arr["NAME"])."','".rawurlencode($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(input)
| {
| //Set a variable to hold the value from the form input field
| var searchCriteria = input.value;
|
| //Empty results select box
| document.getElementById('result').options.length = 0;
|
| //If there is search criteria, then process
| if(searchCriteria.length>0)
| {
| //Pass to php to process
| ajax.requestFile = 'tst2.php?searchCriteria='+searchCriteria;
|
| //Specify function that will be executed to display results
| ajax.onCompletion = createResults;
|
| //Execute AJAX function
| ajax.runAJAX();
| }
| }
|
| function createResults()
| {
| var obj = document.getElementById('result');
|
| //Executing the response from Ajax as Javascript code
| //Sent from php as an escaped string so must escape
| alert(unescape(ajax.response));
| eval(unescape(ajax.response));
| }
|
| </script>
| <!-- END AJAX for processing customer name search -->
|
|
| <table>
| <tr>
| <td><b>Customer Name:</b></td>
| <td>
| <input class="cust" id="search" name="search" type="text"
| onchange="searchInput(this)">
| </td>
| </tr>
| <tr>
| <td>&nbsp;</td>
| <td><select multiple size="10" id="result" name="result">
|
| </select>
| </td>
| </tr>
| </table>
>
---------------------------------------------------------------
jnort...@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Yes do Post-ing with <?php ob_start('ob_gzhandler');?in your PHP
file. This will compress your data.

Manuel Lemos
Guest
 
Posts: n/a
#12: Mar 4 '07

re: ajax.response max size


Hello,

on 02/23/2007 10:48 PM trpost@gmail.com said the following:
Quote:
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?
You may want to take a look at this class that comes with a plug-in
named linked select that links 2 or more select inputs populating each
select input using option values retrieved from a database with AJAX.

http://www.phpclasses.org/formsgeneration

Here is the live example script that demonstrates what you want:

http://www.meta-language.net/forms-e..._linked_select

Here you can see a video of the part of this class tutorial that
explains the linked select input plug-in:

http://www.phpclasses.org/browse/vid...ed-select.html


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Closed Thread


Similar JavaScript / Ajax / DHTML bytes