/* * comments.js * * @description * @author       Razvan Nastase <contact@bonsoftware.com> * @version      1.0 * @created      2008/05/01 09:00:00 * @modified     2008/05/01 09:00:00 * @copyright    Copyright (c) 2009, Bon Media Software - All Rights Reserved * * No part of this document may be reproduced and you may not modify or use this * document for any other purposes (including other projects) without written * consent from the author. Please see http://www.bonsoftware.com/license for * more information. */$(document).ready(function() {    $(".addComment form").unbind("submit.comments");    $(".addComment form").bind("submit.comments", function() {        var form = this;        $('.commentsAlerts').hide();        $.ajax({            url: $(this).attr('action'),            cache: false,            dataType: "json",            type: "post",            data: $(this).serialize() + '&dataType=json',            success: function(data) {                if (data) {                    jsShowMessage(data.message, data.success ? 'success' : 'error');                }                else {                    alert('comments - js error: no data returned');                }                                form.reset()            }        });                return false;    });});
