Can't seem to find a similar question, so here goes; I'm writing a module that manipulates commenting on content types; basically, I'm AJAXifying the comments form so it incorprates new comments, new replies and edits (and before anyone asks, I've looked at ajax_comments and it doesn't do what I want).
Basically, on clicking the "Add" comment, I need to be able to set a class on the link element (i.e. "has-form"), and using an ajax callback within the form function thus:
$items['mycomments/newcomment/%node'] = array( 'delivery callback' => 'ajax_deliver', 'page callback' => 'mycomments_newcomment', 'page arguments' => array(2), 'access callback' => 'node_access', 'access arguments' => array('view', 2), 'type' => MENU_CALLBACK, );
Within the callback function, I need to check whether an element ("#mycommentform") has the class of "has-form" in order to execute ajax_command_* invokes. I know in jQuery I can simply do $("#mycommentform").hasClass("has-form") but how can I do this from within the callback PHP function code?