This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('img').error(function(){ | |
$(this).attr('src', 'img/broken.png'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.btn').hover(function(){ | |
$(this).addClass('hover'); | |
}, function(){ | |
$(this).removeClass('hover'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// para deshabilitar un campo, en este caso un botón para enviar | |
$('input[type="submit"]').attr("disabled", true); | |
// para volver a habilitar el botón | |
$('input[type="submit"]').removeAttr('disabled'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Conexion */ | |
$conexion = mysql_connect('localhost', 'root', ''); | |
mysql_select_db('nombreBBDD', $conexion); | |
/* Consulta */ | |
$sSQL = "SELECT * FROM"; | |
$resultados = mysql_query($sSQL, $conexion) or die(mysql_error()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sHola = 'texto'; | |
$sVariable = 'sHola'; | |
echo $$sVariable; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tabulacion:first-letter { | |
margin-left: 15px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var c = document.getElementById("lienzo"); | |
var ctx = c.getContext("2d"); | |
var imageObj = new Image(); | |
imageObj.src = 'img_the_scream.jpg'; | |
imageObj.onload = function() { | |
ctx.drawImage(imageObj, 69, 50); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ejemplo de formulario con AJAX</title> | |
<style> | |
body { | |
font-size: 14px; | |
text-align: center; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Clase para utilizar la base de datos | |
* 1.1v | |
*/ | |
class DB { | |
//Variables | |
public static $DB_HOST = 'localhost'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; |