Last active
April 13, 2016 17:23
-
-
Save NaokiStark/fb222ccbe8ef97c757f76336d7c3e58e to your computer and use it in GitHub Desktop.
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
Test = function(){ // para orden, los objetos tienen que comenzar con mayúsculas | |
this.prop1 = "Hola"; | |
this.metodo1 = function (){ | |
console.log('esta funcionando el metodo'); | |
} | |
var then = this; //*Magia negra* | |
$('select').change(function(){ | |
then.metodo1(); //WOW | |
//Y podemos usar el this para este objeto jQuery | |
//$(this).hide(); | |
}); | |
} | |
// var objeto1 = new test(); mi codigo no funciona y no sé por qué, declaramos "TEST" y llamamos a "test", que clase de brujería es esta? | |
var objeto1 = new Test(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment