On 9/18/06, Bob Ippolito <[EMAIL PROTECTED]> wrote:
>
> On 9/18/06, John J Lee <[EMAIL PROTECTED]> wrote:
> >
> > On Mon, 18 Sep 2006, Arnar Birgisson wrote:
> > [...]
> > > I have firefox failing on the following whenever length >= 4096:
> > >
> > > @expose("json")
> > > def test(self, len):
> > >    return 'x'*int(len)
> > >
> > > FF is failing in a weird manner, loadJSONDoc returns nothing, and if I
> > > load the url in a new tab it's as if the text is rendered with a white
> > > font (!).
> > >
> > > The HTTP RFC doesn't mention any length limitation and all Safari and
> > > IE both accept anything like this.
> >
> > I doubt this has anything to do with HTTP per se -- surely this has much
> > more to do with XMLHttpRequest and the Firefox DOM than HTTP.
> >
> > IIRC Firefox creates DOM text nodes with a length limit of around that
> > size (4k), instead of creating really big text nodes.  I'm not sure
> > exactly what you're doing with your JSON, but perhaps that's the root
> > cause of the problem.  If not, then, well... something similar ;-)
>
> Well XHR doesn't fail on 4k+ documents, so it's gotta be a client-side
> problem somewhere else. Nothing can be done about this automatically
> on the server side because the JSON spec doesn't allow for that kind
> of chunking.
>
> Perhaps there's a limitation in firefox's eval() implementation that
> only allows for ~4k string tokens? If that's the case, you might be
> able to get away with a pure-JavaScript JSON parser, but it'd be
> extremely slow.
>
> -bob

Thanks all, but I'm sorry for messing you around. This 4K length limit
is on dom text nodes yes - which means firefox can't _display_ the
json output, and thus the xhr response looked empty in my firebug
console. I was having problems that I incorrectly attributed to that -
but as it turned out, XHR wasn't having any problems with long lines.
My problem was something else alltogether.

However, the JSON spec does allow arbitrary white-space between
tokens, so it can be split across lines in most cases.

Sorry again.

Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to