Skip to content

Instantly share code, notes, and snippets.

View jamc92's full-sized avatar
🎯
Focusing

Javier Madrid jamc92

🎯
Focusing
View GitHub Profile
@jamc92
jamc92 / oop.html
Created March 15, 2015 19:43
JS - OOP
<!DOCTYPE html>
<html>
<head>
<title>Oriented Object Programming</title>
<script type="text/javascript">
//Creating an objetc
objeto = new Object();
@jamc92
jamc92 / argumentsToFunctions.html
Created March 15, 2015 19:42
JS - Arguments to functions
<!DOCTYPE html>
<html>
<head>
<title>Arguments to construct functions</title>
</head>
<body>
<script type="text/javascript">
//My object function with parameters
function Book(title, edition, year) {
@jamc92
jamc92 / constructFunction.html
Created March 15, 2015 19:41
JS - Functions
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
//Creating my object function
function myObject() {
//Setting myObject as parent of info while it gets a string
this.info = "My object info";
@jamc92
jamc92 / buildFunctionInheritance.html
Created March 15, 2015 19:40
JS - Inheritance with functions
<!DOCTYPE html>
<html>
<head>
<title>Inheritance from a build Function in JS</title>
<script type="text/javascript">
String.prototype.reverse = function() {
var salida = "";
for (var i = this.length-1; i >= 0; i--) {
salida += this.substr(i, 1);
}
@jamc92
jamc92 / ajaxSuggestion.html
Created February 24, 2015 05:11
JS - Some AJAX (don't remember if it does work)
<!DOCTYPE html>
<html>
<head>
<title>Ajax Suggestion</title>
<script>
//Declaro la funcion con un parametro que tomara el string que se coloque en el input
function showHint (srt) {
//Si no hay nada escrito que devuelta vacio
if (srt.length == 0) {
document.getElementById("txtHint").innerHTML="";
@jamc92
jamc92 / json.html
Created February 24, 2015 05:10
JS - jSON html
<!DOCTYPE html>
<html>
<head>
<title>JSON practice</title>
<script src="json.json"></script>
</head>
<body>
<script>
//Access to information in json object
document.write('Javier is ' + jason.age);
@jamc92
jamc92 / documentHistory.html
Created February 24, 2015 05:09
JS - Document History
<!DOCTYPE html>
<html>
<head>
<title>Document History</title>
<meta charset="utf-8" />
</head>
<body>
<script>
function go() {
@jamc92
jamc92 / inArrayJavascript.html
Created February 22, 2015 18:24
JS - inArray prototype to a function
<!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 / aegumetsDemo.html
Created February 22, 2015 17:06
JS - Send an argument to an js function from <script src=""> tag
<!DOCTYPE html>
<html>
<head>
<title>Arguments Demo</title>
<script src="arguments.js" spinner="spinner.png"></script>
</head>
<body>
</body>
</html>
@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>