Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Firefox 1.5.0.7 on Linux x86_64

1 view
Skip to first unread message

bgshea

unread,
Nov 19, 2006, 5:03:33 AM11/19/06
to
I've run into a problem, but not sure if this is a local issue or
something with the 64bit Linux Firefox or a problem overall. If someone
could help verify or debunk the problem, or point me to a similar
problem that would be helpfull.

If i'm posting to the worng list, can you please point me to the
correct one.

Problem is:

I create an XHTTPRequest in a function and return the object which is
assigned to a varible.

I then use the varible to setup the request headers and open the
connection and send any post data required.

Before sending the post data I assign onload and onprogress. Only the
load function will execute after the request finishs and the onprogress
will never be called.

Now, if i assign onprogress in the function used to create my
XHTTPRequest object, onprogress function will get called.

Working Example:

function makeRequest() {
http_request = new XMLHttpRequest();

http_request.onprogress=doSomething;

return http_request;
}

rq = makeRequest();

... Setup rest of the request stuff

rq.onload=display;
rq.send( data );

Non-Working Example:

function makeRequest() {
http_request = new XMLHttpRequest();

return http_request;
}

rq = makeRequest();

... Setup rest of the request stuff
rq.onprogress=doSomething;
rq.onload=display;
rq.send( data );


The non-working example will never call doSomething, but the working
example will.

anyone know why? Did i miss something?

Please ignore typo's it's 3am and I'm really tired, they don't exist in
my real code.

Thanks in advance.

Boris Zbarsky

unread,
Nov 19, 2006, 6:48:58 AM11/19/06
to
bgshea wrote:
> I then use the varible to setup the request headers and open the
> connection and send any post data required.
>
> Before sending the post data I assign onload and onprogress. Only the
> load function will execute after the request finishs and the onprogress
> will never be called.

There's some code in open() that does things conditionally depending on whether
we have a progress listener. Therefore, for a progress listener to work it must
be set before open() is called.

The documentation does seem to lie about this, doesn't it? :(

-Boris

bgshea

unread,
Nov 19, 2006, 10:59:41 AM11/19/06
to

Cool, thanks, I thought i had missed something guess for a good reason.
I will keep this in mind. I do have a MDC account, but i will leave the
Documentation edits up to someone that is more farmilar with doing such
a task.

Boris Zbarsky

unread,
Nov 19, 2006, 3:54:08 PM11/19/06
to
bgshea wrote:
> Cool, thanks, I thought i had missed something guess for a good reason.
> I will keep this in mind. I do have a MDC account, but i will leave the
> Documentation edits up to someone that is more farmilar with doing such
> a task.

I filed bug https://bugzilla.mozilla.org/show_bug.cgi?id=361222 on the IDL
comments; once we sort those out we can update MDC too.

Like the bug says, we'll probably need to make an incompatible change here in
the 1.9 or later timeframe...

-Boris

0 new messages