473,545 Members | 2,755 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xmlhttprequest to get dynamically generated data seems to have a size limit

hi everybody, i hope this is the right place to discuss this weird
behaviour. i am getting dynamically generated text or xml from the
server side using xmlhttprequest. if the server side data is STATIC, i
can have whatever size of data i want.

but if the data (xml or text) is generated dynamically using php, then
there seems to be a size limit! xmlhttprequest' s responseText is
truncated, and the xml therefore not well fromed. in border cases (just
about a little above some file size limit), there is even RANDOM
behaviour, sometimes it works, and when refreshing it does not work,
and the next time it works again.

anybody having similar issues? if you're interested, i can also post
code and a detailed summary of when this behaviour occurs.

greetings to all of you,
ted

Jan 16 '06 #1
27 13006
VK

ted benedict wrote:
hi everybody, i hope this is the right place to discuss this weird
behaviour. i am getting dynamically generated text or xml from the
server side using xmlhttprequest. if the server side data is STATIC, i
can have whatever size of data i want.

but if the data (xml or text) is generated dynamically using php, then
there seems to be a size limit! xmlhttprequest' s responseText is
truncated, and the xml therefore not well fromed. in border cases (just
about a little above some file size limit), there is even RANDOM
behaviour, sometimes it works, and when refreshing it does not work,
and the next time it works again.

anybody having similar issues? if you're interested, i can also post
code and a detailed summary of when this behaviour occurs.

greetings to all of you,
ted


I bet my sugar against your coffee that you are hitting the GET limits
imposed by IE:
<http://www.ajaxtoolbox .com/forum/viewtopic.php?t =26>
derived from
<http://support.microso ft.com/default.aspx?sc id=KB;en-us;q208427>

You should use only clj endorsed well-formed libraries like AjaxToolBox
to be protected from the known, mal-known and unknown issues of Ajax
technologies sets.

IMHighlyHO

Jan 16 '06 #2


ted benedict wrote:

but if the data (xml or text) is generated dynamically using php, then
there seems to be a size limit! xmlhttprequest' s responseText is
truncated, and the xml therefore not well fromed.
Consider not to use responseText at all, rather make your PHP script do
header('Content-Type: application/xml');
before it sends any XML data and that way the XMLHttpRequest object you
use will automatically parse the response body and build responseXML.
in border cases (just
about a little above some file size limit), there is even RANDOM
behaviour, sometimes it works, and when refreshing it does not work,
and the next time it works again.


Is that happening with all browsers or just one particular browser
respectively one particular implementation of XMLHttpRequest?
What does
httpRequestObje ct.status
httpRequestObje ct.statusText
httpRequestObje ct.getAllRespon seHeaders()
look like when you have problems?

How long does (e.g. some seconds or a minute or even several minutes?)
the PHP script need to write the complete data, perhaps the browser
times out before the script has finished?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 16 '06 #3
VK wrote:
ted benedict wrote:
hi everybody, i hope this is the right place to discuss this weird
behaviour. i am getting dynamically generated text or xml from the
server side using xmlhttprequest. if the server side data is STATIC, i
can have whatever size of data i want.

but if the data (xml or text) is generated dynamically using php, then
there seems to be a size limit! xmlhttprequest' s responseText is
truncated, and the xml therefore not well fromed.

in border cases (just
about a little above some file size limit), there is even RANDOM
behaviour, sometimes it works, and when refreshing it does not work,
and the next time it works again.
[...]


I bet my sugar against your coffee that you are hitting the GET limits
imposed by IE:


You lose again. He was talking about the response text (responseText
property) being truncated, which does not have anything to do with the
URI length limit IE imposes.
PointedEars
Jan 16 '06 #4
ted benedict wrote:
[...]
but if the data (xml or text) is generated dynamically using php, then
there seems to be a size limit!
Maybe you generate a wrong Content-Length header. The reason of this
could be that you use a flawed mod_gzip version, or a flawed cgi_buffer
version or use the latter in the wrong way. Whatever the reason is,
the error is unlikely to be on the client side.
xmlhttprequest' s responseText is truncated, and the xml therefore not well
fromed. [...]


Why are you using `responseText' in the first place? If you serve an XML
document (text/xml) as response, use `responseXML' and parse the resulting
element tree instead.
HTH

PointedEars
Jan 16 '06 #5
VK

Thomas 'PointedEars' Lahn wrote:
You lose again. He was talking about the response text (responseText
property) being truncated, which does not have anything to do with the
URI length limit IE imposes.


You lose again. The truncation happens on the client side *before*
request is being sent - if it's GET and if it's longer than
GET-maxlength.

You really should use the software you're advising about - because
ECMA/W3C text data is mainly a source of fun rather than information.
;-)

Jan 16 '06 #6
thanks for the answer, i only use responseText for checking. (because
if it is truncated, i won't get a responseXML object (because the xml
is malformed if the text of it is truncated).

the border case fun RANDOM behavior happens with IE (what a surprise.
;-) )

thanks for the hints, i'll check these

httpRequestObje ct.status
httpRequestObje ct.statusText
httpRequestObje ct.getAllRespon seHeaders()

the php only has some seconds, not really much.

Jan 16 '06 #7
Thomas 'PointedEars' Lahn, thanks for your answer.

i don't really generate any header information myself. i just use a php
script and build the xml using echo('....') commands. (because i have
to use php4 and don't want to use the deprecated xml dom lib)

Jan 16 '06 #8
ok i decided to post more detailed information.

1. dynamically generated TEXT from a server side php script.
---------------------------------------------------------------------------------------
the server side script looks like this:
<?php
echo('text ');
?>

if i use xmlhttprequest to GET this file, asynchronously, and then use
(AFTER the request object's state is 4) .responseText, i can read out
'text'. now, depending on the size of this file, i'll get the complete
generated text or not.

case 1: echo('text '); repeated for about 80kB of space.
in firefox, no problems occured. in internet explorer, the
..responseText returned the full generated text.

case 2: echo('text '); repeated for about 120kB of space.
in firefox, no problems occured. in internet explorer, the
..responseText only returns a truncated version, not everything.

2. dynamically generated XML from a server side php script.
---------------------------------------------------------------------------------------
the server side script looks like this:
<?php
header("Content-type: text/xml; charset=iso-8859-1");
echo('<entries> ');
echo('<entry>') ;
// more elements
echo('</entry>');
echo('</entries>');
?>

case 1: copy pasted the entry generating echo statements, repeated for
about 55kB of space.
using .responseText, in firefox, no problems occured. in internet
explorer, the full generated xml is returned
using .responseXML and counting the entry elements for example, in
firefox, no problems, in ie no problems

case 2: copy pasted the entry generating echo statements, repeated for
about 220kB of space.
using .responseText, in firefox and in internet explorer, only partial
data is displayed if i print it to a <div> for example
using .responseXML and counting the entry elements for example, in
firefox and in ie, the responseXML cannot be accessed as it received
truncated data and did not build up correctly.
now this was a little a simplification because i did more experiments
to get the file sizes and cases more exactly (ie fails to receive and
build the responseXML object sooner than firefox, for example)
i hope this explained my problem? i hope it was interesting for you to
see what weird things happen :)

greetings and all the best to you all

Jan 16 '06 #9
"VK" <sc**********@y ahoo.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .

ted benedict wrote:
hi everybody, i hope this is the right place to discuss this weird
behaviour. i am getting dynamically generated text or xml from the
server side using xmlhttprequest. if the server side data is STATIC, i
can have whatever size of data i want.

but if the data (xml or text) is generated dynamically using php, then
there seems to be a size limit! xmlhttprequest' s responseText is
truncated, and the xml therefore not well fromed. in border cases (just
about a little above some file size limit), there is even RANDOM
behaviour, sometimes it works, and when refreshing it does not work,
and the next time it works again.

anybody having similar issues? if you're interested, i can also post
code and a detailed summary of when this behaviour occurs.

greetings to all of you,
ted


I bet my sugar against your coffee that you are hitting the GET limits
imposed by IE:
<http://www.ajaxtoolbox .com/forum/viewtopic.php?t =26>
derived from
<http://support.microso ft.com/default.aspx?sc id=KB;en-us;q208427>


And what does the response have to do with IE's GET limit?

Read the OP properly:
"..., there is even RANDOM behaviour, sometimes it works,
and when refreshing it does not work, and the next time
it works again."

Refreshing implies the *same* GET URI... and sometimes it works!
IE's GET limit is fixed, and does *not* vary between calls.

To the OP:

Can you post your response function, so we don't have to guess
what goes wrong?

My guess is that you post or get async, but doesn't wait until
readyState and status is set properly, so you get a race with
the server...:

if (req.readyState == 4) {
if (req.status == 200) {
// ...processing.. .
} else {
alert(\"There was a problem retrieving the XML data:\n\");
}
}
--
Dag.
Jan 16 '06 #10

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

Similar topics

2
2686
by: Adam | last post by:
This is frustrating me. Opening IE displays the following code fine. When I open a new window the code no longer works. All the HTML is overwritten with the first document.write statement. Tried with window tried without Please help. This code pulls XML from a web site then parses it into a dynamically created table built with javascript....
2
6523
by: dx27s | last post by:
Hi all, I'm working with the XMLHttpRequest object. I receive the following error message: "Permission denied to call method XMLHttpRequest.open" This occurs in Firefox only. IE works fine. From my research so far, it seems like this is a security issue related to the fact that I am trying to access a url on a second server. Both...
2
2115
by: Sethos | last post by:
I am sure that this has been covered, hashed, and rehashed, but a search on the group did not produce the answer, so forgive me if this seems like a "newbie" type question... Besically, I have a form on which the users can click on a button to add text boxes dynamically. That all works without a hitch. The problem comes in trying to verify...
9
2141
by: Phil_Harvey | last post by:
I am redoing my website and trying to get it to do something more exciting using Javascript. I did normal Java at university and code at work in VB.NET. I have got reasonably far into what I want to do but am having some issues. Firstly I am using an XmlHttpRequest to pull html fragments out of files and wish to put them into the main...
2
3430
by: xhunga | last post by:
I have try a new version of my work. I have put the sizes of the matrix into the matrix. A = number of rows A = number of columns The first element of the matrix is A instead of A. You can not use the row 0, and the column 0.
5
15493
by: HugeBob | last post by:
Hi All, I've got a question about Asynchronous vs Synchronous mode with the XMLHttpRequest object. What are the ramifications of using one mode vs the other? If the script uses Asynchronous mode, it sounds as if a thread retrieves the data from the supplied URL and the JS function that called the open() and send() methods continues on. ...
64
9652
by: Philip Potter | last post by:
Hello clc, I have a buffer in a program which I write to. The buffer has write-only, unsigned-char-at-a-time access, and the amount of space required isn't known a priori. Therefore I want the buffer to dynamically grow using realloc(). A comment by Richard Heathfield in a thread here suggested that a good algorithm for this is to use...
2
4982
by: Wizfrog | last post by:
Hello, I'm working with a pretty large XML file, but I really only need to display a few things that requires quite a few transforms. I already limited to the transforms to the data i need to use, but I'd like to speed things up by loading only the data I need. I need to mention that this is for a local application that sometimes will...
0
7499
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7432
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...
0
7943
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...
1
7456
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...
0
7786
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...
1
5359
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...
0
5076
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...
1
1919
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
743
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...

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.