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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---