WPAjax and responseText
-
Here’s the code:
var commodAjax = new WPAjax( false, 'post-'+postid );
commodAjax.options.parameters += '&action=rate_post&id=' + postid + '&rate=' + rate;
// Execute Order 66
commodAjax.request(commodAjax.url);
alert(commodAjax.responseText);Here’s the response:
undefined
According to FireBug, I am successfully sending postdata and getting a response of “1”. I’d like to take the response and make use of it, but it’s not working.
I’m writing an extension that allows post rating (user moderation) and this is the final hitch I’m running into. I want to make sure that if the request is not sucessful (ie, it returns 0 or -1) that the browser doesn’t continue executing stuff.
Sorry, it’s a bit borked, I’ll post more code if necessary.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.