/* $(".confirmComentario").click(function(e) { e.preventDefault(); var targetUrl = $(this).attr("href"); $("#dialog-alert p").html(texto); $("#dialog-alert").dialog({ modal: true, title: "ATENCIÓN", buttons : { "Si" : function() { window.location.href = targetUrl; }, "No" : function() { $(this).dialog("close"); } } }); $("#dialog-alert").dialog("open"); }); function confirma(texto) { var resp=false; $("#dialog-alert p").html(texto); $("#dialog-alert").dialog({ modal: true, title: "ATENCIÓN", close: function() { return resp; }, buttons: { "Si": function() { resp=true; $(this).dialog("close"); } ,"No": function() { $(this).dialog("close"); } } }); } */ function alerta(texto) { $("#dialog-alert p").html(texto); $("#dialog-alert").dialog({ modal: true, title: "ATENCIÓN", buttons: { Cerrar: function() { $( this ).dialog( "close" ); } } }); } function comprobarUsuario() { var resultado; $.ajax({ type: "get", url: "/privado/comprobarUsuario.html", cache: false, async: false, success: function(result) { resultado = result; } }); if(resultado == 'ok') return true; else { alerta("Para poder ver el perfil tienes que
iniciar sesión o registrarte"); return false; } } function comprobarAmigo(id) { $.ajax({ type: "get", url: "/privado/comprobarAmigo.html", data: "id="+id, cache: false, async: false, success: function(result) { resultado = result; } }); if(resultado == 'ok') return true; else { alerta("Debes ser amigo del usuario para poder enviarle un mensaje."); return false; } }