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
.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
<?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
<?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
// 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
$('.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
$('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
$('img').load(function() { | |
//se cargaron las imagenes completamente | |
}); |
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
$('a.top').click(function(){ | |
$('html, body').animate({scrollTop : 0},800); | |
return false; | |
}); | |
//HTML | |
<a class="top" href="#">Arriba</a> |
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 | |
/* Insertar */ | |
INSERT INTO usuarios VALUES ('', 'Lisa'); | |
INSERT INTO usuarios (nombre, id) VALUES | |
('Flanders', NULL); | |
/* Consulta */ | |
SELECT * FROM usuarios; | |
SELECT nombre FROM usuarios; |