The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How do I get my AJAX to be asynchronous?
The following code doesn't work, it runs before the response is received so everything is undefined. If you change the agent object to be synchronous (change the first line's true to false), it works fine.
Code:
function rateQuote(e, rating, quoteId) { agent = new vB_AJAX_Handler(true); agent.send('quotes.php', '&do=rate&ajax=y"eid=' + quoteId + '&vote=' + rating); if (checkAgentStatus()) { var results = agent.handler.responseText.split("\t"); fetch_object('stats' + quoteId).innerHTML = quotes_phrase_total + ': ' + results[0] + ' - ' + quotes_phrase_votes + ': ' + results[1] + ' - ' + quotes_phrase_average + ': ' + results[2]; fetch_object('rating' + quoteId).innerHTML = quotes_phrase_you_rated_this + results[3]; do_an_e(e); } } |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|