function redirectDialog(){ $("#container").prepend("
\n

\n Вы пытаетесь перейти по ссылке ведущей на внешний сайт.\n <\/p>\n

\n http%3A%2F%2Fwww.povarenok.ru%2Frecipes%2Fshow%2F85368%2F\n <\/p>\n<\/div>\n"); $("#redirect-popup").dialog({ autoOpen: true, width: 400, modal: true, title: 'Переход по ссылке', buttons: { 'Перейти': function(){ window.open('http%253A%252F%252Fwww.povarenok.ru%252Frecipes%252Fshow%252F85368%252F', '_blank'); $(this).dialog("close"); }, 'Отменить': function(){ $(this).dialog("close"); } } }).bind("dialogclose", function(event, ui) { $(this).remove(); }); } if(!jQuery.ui || !jQuery.ui.dialog){ $.ajax({ url: '/assets/source/jquery-ui-1.8.17.custom.js', success: function(){ redirectDialog(); } }); } else{ redirectDialog(); }