Skip to content

Instantly share code, notes, and snippets.

View jamc92's full-sized avatar
🎯
Focusing

Javier Madrid jamc92

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Callback in AJAX</title>
<script>
var xmlhttp;
//Se declara la funcion principal con sus parametros
function loadXMLDoc(url, callFunction) {
@jamc92
jamc92 / fahrenheitCelsius.html
Created February 22, 2015 16:07
JS - Fahrenheit to Celsius
<!--@authot Javier Madrid-->
<!DOCTYPE html>
<html>
<head>
<title> De Fahrenheit a Celsius</title>
</head>
<body>
<script>
//Asignando valor a variable
var cTemp = 100;
@jamc92
jamc92 / functionEvent.html
Last active August 29, 2015 14:15
JS - Event on click
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> Evento On Click</title>
</head>
<body>
<input type="button" value="Púlsame" onclick="alert('Soy un evento')" />
</body>
</html>
@jamc92
jamc92 / javascript.html
Created February 22, 2015 16:09
JS - Hello World
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hola mundo de Javascript</title>
</head>
<body>
<script>
//Alerta en una ventana emergente
@jamc92
jamc92 / getInfoEvent.html
Created February 22, 2015 16:09
JS - getInfoEvent
<!DOCTYPE html>
<html>
<head>
<title> Evento de información </title>
<script>
function infoButton(buttonId, buttonName, buttonValue) {
var idButton = "ID del boton " + buttonId + " \n";
var nameButton = "Button's name: " + buttonName + " \n";
var valueButton = "Button's value: " + buttonValue + " \n";
@jamc92
jamc92 / returnFunction.html
Created February 22, 2015 16:10
JS - Return Function
<!DOCTYPE html>
<html>
<head>
<title>Return Function</title>
<script>
function circleArea(r) {
this.r = r;
return 3,1416 * (r * r);
}
</script>
@jamc92
jamc92 / controllingScope.js
Created February 22, 2015 16:16
JS - Call()
//Playing with call() method from JS
function sayFavoriteFood() {
console.log(this.sayFavoriteFood);
}
// create a desmond object
var javier = {
favoriteFood: 'kiwi';
@jamc92
jamc92 / cookies.html
Created February 22, 2015 16:17
JS - Cookies
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Cookies en JS</title>
</head>
<script>
@jamc92
jamc92 / index.html
Created February 22, 2015 16:18
JS - Function as a Parameter
<!--(method - filter())-->
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Function as a Parameter - Lambdas</title>
<script src="main.js"></script>
</head>
<body>
@jamc92
jamc92 / index.html
Last active August 29, 2015 14:15
JS - Function as a return value
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Fuction as a Return</title>
</head>
<body>
<script src="returnFunction.js"></script>
</body>
</html>