Articulos PHP
- 3.3 Transformando series en variables.
- 2.4 Ciclo WHILE.
- 1.8 Arreglos o array.
- 3 PHP junto con MySQL.
- 3.2 Obteniendo información de la base de datos.
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.5 Recorriendo el array con each().
- 3.1 Callback en Jquery
- 2.7 Listas desplegables con change()
- 2.3 Pasando el cursor sobre un elemento.
- 1.5 El evento keypress
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 Hojas de estilo CSS.
- 1.1 Como incluir estilos en una página web.
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 MySQL.
- 2 Expresiones <,>,<= y >=.
- 2.5 Seleccionando filas con NOT LIKE.
- 1.6 Ordernar valores con ORDER BY.
- 2.7 Conjunción interna de tablas.
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



