Articulos PHP
- 1.4 Trabajar con números en PHP.
- 2.6 Saltando un ciclo con CONTINUE
- 2.2 Ciclo FOR.
- 3.1 Conexión MySQL con enunciado die.
- 2.7 Enlazar un programas con include.
Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 128
Articulos Jquery
- 2.4 Usando AJAX con el método .post().
- 1.9 El elemento on.
- 1.6 El método preventDefault.
- 2.6 El efecto fadeIn y fadeOut.
- 2 Añadiendo elementos a la página con append().
Warning: Use of undefined constant jquery - assumed 'jquery' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 137
Articulos CSS
- 1.2 Estructura de los estilos CSS.
- 1.1 Como incluir estilos en una página web.
- 1 Hojas de estilo CSS.
Warning: Use of undefined constant css - assumed 'css' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 146
Articulos Mysql
- 1.8 Seleccionando registros con WHERE.
- 1 MySQL.
- 2 Expresiones <,>,<= y >=.
- 3.5 Crear y borrar una base de datos
- 3.9 Privilegios o permisos en MySQL
Warning: Use of undefined constant mysql - assumed 'mysql' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 155
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 199
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
1.6 El método preventDefault().
El método preventDefault() se utiliza para impedir que un determinado evento se ejecute con normalidad, es decir, hace que un determinado evento se interrumpa. Recordemos que un evento puede ser cualquier acción realizada por el usuario.Ahora para entender su funcionamiento, supongamos que deseamos tener un campo de texto y que deseamos que no se pueda introducir texto dentro de este último (algo muy extraño, pero ilustrativo), el campo de texto serÃa el siguiente:
 <input type=”text” size=”30” class=”campoPrueba”/>
Entonces el código Jquery necesario serÃa el siguiente:
$(document).ready(function(){
        $(“.campoPrueba”).keypress(function(evento){
                      evento.preventDefault();
          });
});
El código consiste en lo siguiente:
- La primera parte $(document).ready(function(){}); permite que el código de Jquery se ejecute hasta que se haya descargado correctamente todo el código HTML.
- La segunda parte $(“.campoPrueba”).keypress(function(evento){…}); es la encargada de contener el código a ejecutarse cada vez que el usuario ingrese un carácter. Es importante mencionar que evento hace referencia a la acción llevada a cabo por el usuario, en este caso, ingresar un carácter.
- La tercera y última parte evento.preventDefault(); se encarga de impedir que el evento de ingresar un carácter se lleve a cabo.
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
El método preventDefault.
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
1.6