function cleanFlashMsg() { var fm = $('#flashMsg'); fm.stop( true, true ); fm.fadeOut(10); fm.text(''); $('#l').select(); } function showFlashMsg( sFlashMsg ) { var fm = $('#flashMsg'); fm.text( sFlashMsg ); fm.fadeIn(10); setTimeout( "$('#flashMsg').fadeOut(700);", 5000 ); } function submitFData() { cleanFlashMsg(); // Limpiamos mensaje de la pantalla var lURL = $('#l'); if( undefined == lURL.val() || '' == lURL.val().trim() ) { showFlashMsg( 'Indique la URL a acortar' ); lURL.focus(); return false; } // Ejecutamos la orden $.post('/add.php', $('#fdata').serialize(), function(resp, ts) { if( resp.flashMsg != undefined ) { showFlashMsg( resp.flashMsg ); } else { if( $('#'+resp.w).get(0) == undefined ) // Si no existe en la tabla,... { $('#tbURL').before( '