Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Javier Madrid jamc92

🎯
Focusing
View GitHub Profile
@jamc92
jamc92 / returnFunction.html
Created Feb 22, 2015
JS - Return Function
View returnFunction.html
<!DOCTYPE html>
<html>
<head>
<title>Return Function</title>
<script>
function circleArea(r) {
this.r = r;
return 3,1416 * (r * r);
}
</script>
@jamc92
jamc92 / inArrayJavascript.html
Created Feb 22, 2015
JS - inArray prototype to a function
View inArrayJavascript.html
<!DOCTYPE html>
<html>
<head>
<title>in_array in JS</title>
</head>
<body>
<script>
//Se asigna la funcion agregandole una propiedad de arreglo al objeto.
Array.prototype.inArray = function() {
//para la variable en este caso
@jamc92
jamc92 / index.html
Last active Aug 29, 2015
JS - Function as a return value
View index.html
<!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>
@jamc92
jamc92 / fahrenheitCelsius.html
Created Feb 22, 2015
JS - Fahrenheit to Celsius
View fahrenheitCelsius.html
<!--@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 / aegumetsDemo.html
Created Feb 22, 2015
JS - Send an argument to an js function from <script src=""> tag
View aegumetsDemo.html
<!DOCTYPE html>
<html>
<head>
<title>Arguments Demo</title>
<script src="arguments.js" spinner="spinner.png"></script>
</head>
<body>
</body>
</html>
@jamc92
jamc92 / functionEvent.html
Last active Aug 29, 2015
JS - Event on click
View functionEvent.html
<!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>
View callbackExample.html
<!DOCTYPE html>
<html>
<head>
<title>Callback in AJAX</title>
<script>
var xmlhttp;
//Se declara la funcion principal con sus parametros
function loadXMLDoc(url, callFunction) {
View controllingScope.js
//Playing with call() method from JS
function sayFavoriteFood() {
console.log(this.sayFavoriteFood);
}
// create a desmond object
var javier = {
favoriteFood: 'kiwi';
View cookies.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Cookies en JS</title>
</head>
<script>
View javascript.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hola mundo de Javascript</title>
</head>
<body>
<script>
//Alerta en una ventana emergente