{script} {literal} $("a.blog_delete_attachment").each(function(){ $(this).click(function(){ if ( confirm(OW.getLanguageText('blog', 'confirm_delete_attachment')) ) { var attachment_id = $(this).data("aid"); var attachmentDeleteCode = $(this).attr("code"); var params = {}; var url = '{/literal}{url_for_route for='blog_delete_attachment'}{literal}'; params['attachmentId'] = attachment_id; if(attachmentDeleteCode!=null && attachmentDeleteCode!=undefined) { params['attachmentDeleteCode'] = attachmentDeleteCode; } $.ajaxSetup({dataType: 'json'}); $.post(url, params, function(data){ if ( data.result == true ) { OW.info(data.msg); window.location = window.location; } else if (data.error != undefined) { OW.warning(data.error); } }); } else { return false; } }); }); {/literal} {/script}