First, thanks for the great module! I have a video player with a playlist on the same page as your comment block. Each video is associated with a node and my goal is for the comments to change as each video plays in the playlist. I got the comment block to change when the playlist goes to the next video use this ajax call:
function sendCommentAjax(nid){
var target = ".view-dom-id-1";
var currLink = "/views/ajax?js=1&page=1&view_name=comments&view_display_id=block_1&view_args="+nid+"&view_path=node%2F"+nid+"&view_base_path=null&view_dom_id=1&pager_element=0";
$.ajax({
url: currLink,
type: 'GET',
//data: nid,
success: function(response) {
if (response.__callbacks) {
$.each(response.__callbacks, function(i, callback) {
$('.ajax-form').removeClass('ajax-form').addClass('ajax-form-temp');
eval(callback)(target, response);
$('.ajax-form-temp').addClass('ajax-form');
});
}
},
error: function() { alert(Drupal.t("An error occurred at @path.", {'@path': ajax_path})); },
dataType: 'json'
});
}
I am grabbing the nid from the playlist. Now I need to make another ajax call that refreshes the form block so that its action is:
/comment/reply/1360
I tried just replacing the action with
var actionUrl = "/comment/reply/"+nid;
$('#comment-form').attr("action",actionUrl);
But I guess that doesn't jive with all the hidden element tokens. So how would I go about refreshing this form so I can submit comments to the newly refreshed view?