Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Perlmonks AJAX Voting (greasemonkey plugin)

by citromatik (Curate)
on Dec 13, 2007 at 11:17 UTC ( [id://656805]=note: print w/replies, xml ) Need Help??


in reply to Re: Perlmonks AJAX Voting (greasemonkey plugin)
in thread Perlmonks AJAX Voting

Maybe I'm wrong, but I see that you are using global xmlHttpReq objects in asynchronous requests. This could lead into problems, because a second (and successive) asynchronous request (i.e. a second vote in the page) will overwrite previous ones if they are not finished and you'll never receive a response from them.

There are some ways of solving this, for example, putting multiple xmlHttpReq objects in an array.

Sorry if I misread your code

citromatik
  • Comment on Re^2: Perlmonks AJAX Voting (greasemonkey plugin)

Replies are listed 'Best First'.
Re^3: Perlmonks AJAX Voting (greasemonkey plugin)
by eric256 (Parson) on Dec 13, 2007 at 14:04 UTC

    Thanks for that catch, I updated the code to use local variables, some testing shows that this works now. Guess I never though of anyone voting that fast!


    ___________
    Eric Hodges

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://656805]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-20 02:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found