Hi! Sorry if my question is a newbie one but I try to google before ask here without lucky I try to create a class called NodoYanged like this: var NodoYanged = Class.create({ initialize: function(objeto, padre) { this.padre = padre; this.objeto = objeto; this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; this.intercambiador this.objeto.getElementsByClassName(''Intercambiador'')[0]; this.contenido = this.objeto.getElementsByClassName(''Contenidos'') [0]; } }); Then I try to use it like this: Event.observe(window, ''load'', function() { document.ArbolYanged = new NodoYanged($$(''#Contenido dl'')[0]); }); I even try this: Event.observe(window, ''load'', function() { var ArbolYanged = new NodoYanged($$(''#Contenido dl'')[0]); }); But firebug say everytime the same: this.initialize has no properties prototype.js (line 37) Can you point me where is the error, please? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote:> > Hi! > Sorry if my question is a newbie one but I try to google before ask > here without lucky > > I try to create a class called NodoYanged like this: > > var NodoYanged = Class.create({ > initialize: function(objeto, padre) { > this.padre = padre; > this.objeto = objeto; > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > this.intercambiador > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > [0]; > } > });[...]> this.initialize has no properties prototype.js (line 37) > Can you point me where is the error, please?Class.create doesn''t take any arguments (at least in 1.5.0, I may be behind). You need to Object.extend(NodoYanged.prototype, { ... }).> Thanks!--Greg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 31/10/2007, Gregory Seidman <gsslist+prototype-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote:> > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > Hi! > > Sorry if my question is a newbie one but I try to google before ask > > here without lucky > > > > I try to create a class called NodoYanged like this: > > > > var NodoYanged = Class.create({ > > initialize: function(objeto, padre) { > > this.padre = padre; > > this.objeto = objeto; > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > this.intercambiador > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > [0]; > > } > > }); > [...] > > this.initialize has no properties prototype.js (line 37) > > Can you point me where is the error, please? > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > behind). You need to Object.extend(NodoYanged.prototype, { ... }).I would take a serious look at http://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-class-and-event-apis-hash-rewrite-and-bug-fixes Specifically "Changes to the Class API". and http://prototypejs.org/learn/class-inheritance for a tutorial on the whole thing. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Gregory, hi Richard! For Greg (may I call you Greg?) In the new version of prototye (you could se the tutorial in the second link from Richard) you could find the new way to create a class For Richard: sure I use the tutorial to create the class did you see any error? Thanks! On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > Hi! > > > Sorry if my question is a newbie one but I try to google before ask > > > here without lucky > > > > I try to create a class called NodoYanged like this: > > > > var NodoYanged = Class.create({ > > > initialize: function(objeto, padre) { > > > this.padre = padre; > > > this.objeto = objeto; > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > this.intercambiador > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > [0]; > > > } > > > }); > > [...] > > > this.initialize has no properties prototype.js (line 37) > > > Can you point me where is the error, please? > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > Specifically "Changes to the Class API". > > andhttp://prototypejs.org/learn/class-inheritancefor a tutorial on > the whole thing. > > -- > ----- > Richard Quadling > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > "Standing on the shoulders of some very clever giants!"--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 31/10/2007, Garito <garito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi Gregory, hi Richard! > For Greg (may I call you Greg?) In the new version of prototye (you > could se the tutorial in the second link from Richard) you could find > the new way to create a class > > For Richard: sure I use the tutorial to create the class did you see > any error? > > Thanks! > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > Hi! > > > > Sorry if my question is a newbie one but I try to google before ask > > > > here without lucky > > > > > > I try to create a class called NodoYanged like this: > > > > > > var NodoYanged = Class.create({ > > > > initialize: function(objeto, padre) { > > > > this.padre = padre; > > > > this.objeto = objeto; > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > this.intercambiador > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > [0]; > > > > } > > > > }); > > > [...] > > > > this.initialize has no properties prototype.js (line 37) > > > > Can you point me where is the error, please? > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > Specifically "Changes to the Class API". > > > > andhttp://prototypejs.org/learn/class-inheritancefor a tutorial on > > the whole thing.getElementsByClassName is a deprecated method. Can you try this ... var NodoYanged = Class.create({ initialize: function(objeto, padre) { this.padre = padre; this.objeto = objeto; this.tipo = objeto.select(''.Tipo'').first(); this.texto = objeto.select(''.Texto'').first(); this.intercambiador = objeto.select(''.Intercambiador'').first(); this.contenido = objeto.select(''.Contenidos'').first(); } }); -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry Richard but with your modification the error is raised like with the other version Any clue? Thanks! On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hi Gregory, hi Richard! > > For Greg (may I call you Greg?) In the new version of prototye (you > > could se the tutorial in the second link from Richard) you could find > > the new way to create a class > > > For Richard: sure I use the tutorial to create the class did you see > > any error? > > > Thanks! > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > Hi! > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > here without lucky > > > > > > I try to create a class called NodoYanged like this: > > > > > > var NodoYanged = Class.create({ > > > > > initialize: function(objeto, padre) { > > > > > this.padre = padre; > > > > > this.objeto = objeto; > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > this.intercambiador > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > [0]; > > > > > } > > > > > }); > > > > [...] > > > > > this.initialize has no properties prototype.js (line 37) > > > > > Can you point me where is the error, please? > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > Specifically "Changes to the Class API". > > > > andhttp://prototypejs.org/learn/class-inheritancefora tutorial on > > > the whole thing. > > getElementsByClassName is a deprecated method. > > Can you try this ... > > var NodoYanged = Class.create({ > initialize: function(objeto, padre) { > this.padre = padre; > this.objeto = objeto; > this.tipo = objeto.select(''.Tipo'').first(); > this.texto = objeto.select(''.Texto'').first(); > this.intercambiador = objeto.select(''.Intercambiador'').first(); > this.contenido = objeto.select(''.Contenidos'').first(); > } > > }); > > -- > ----- > Richard Quadling > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > "Standing on the shoulders of some very clever giants!"--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Can you give more of a context? Live page? As the class requires 2 parameters, they will need to be supplied in some fashion. Also, as they are accessing the DOM, you will need to make sure that the DOM is loaded before you try to create an instance of this class. On 31/10/2007, Garito <garito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Sorry Richard but with your modification the error is raised like with > the other version > > Any clue? > > Thanks! > > On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > Hi Gregory, hi Richard! > > > For Greg (may I call you Greg?) In the new version of prototye (you > > > could se the tutorial in the second link from Richard) you could find > > > the new way to create a class > > > > > For Richard: sure I use the tutorial to create the class did you see > > > any error? > > > > > Thanks! > > > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > wrote: > > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > > > Hi! > > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > > here without lucky > > > > > > > > I try to create a class called NodoYanged like this: > > > > > > > > var NodoYanged = Class.create({ > > > > > > initialize: function(objeto, padre) { > > > > > > this.padre = padre; > > > > > > this.objeto = objeto; > > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > > this.intercambiador > > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > > [0]; > > > > > > } > > > > > > }); > > > > > [...] > > > > > > this.initialize has no properties prototype.js (line 37) > > > > > > Can you point me where is the error, please? > > > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > > > Specifically "Changes to the Class API". > > > > > > andhttp://prototypejs.org/learn/class-inheritancefora tutorial on > > > > the whole thing. > > > > getElementsByClassName is a deprecated method. > > > > Can you try this ... > > > > var NodoYanged = Class.create({ > > initialize: function(objeto, padre) { > > this.padre = padre; > > this.objeto = objeto; > > this.tipo = objeto.select(''.Tipo'').first(); > > this.texto = objeto.select(''.Texto'').first(); > > this.intercambiador = objeto.select(''.Intercambiador'').first(); > > this.contenido = objeto.select(''.Contenidos'').first(); > > } > > > > }); > > > > -- > > ----- > > Richard Quadling > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > "Standing on the shoulders of some very clever giants!" > > > > >-- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 31/10/2007, Richard Quadling <rquadling-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Can you give more of a context? Live page? As the class requires 2 > parameters, they will need to be supplied in some fashion. > > Also, as they are accessing the DOM, you will need to make sure that > the DOM is loaded before you try to create an instance of this class. > > > > On 31/10/2007, Garito <garito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Sorry Richard but with your modification the error is raised like with > > the other version > > > > Any clue? > > > > Thanks! > > > > On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > > > > > > > Hi Gregory, hi Richard! > > > > For Greg (may I call you Greg?) In the new version of prototye (you > > > > could se the tutorial in the second link from Richard) you could find > > > > the new way to create a class > > > > > > > For Richard: sure I use the tutorial to create the class did you see > > > > any error? > > > > > > > Thanks! > > > > > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > wrote: > > > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > > > > > Hi! > > > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > > > here without lucky > > > > > > > > > > I try to create a class called NodoYanged like this: > > > > > > > > > > var NodoYanged = Class.create({ > > > > > > > initialize: function(objeto, padre) { > > > > > > > this.padre = padre; > > > > > > > this.objeto = objeto; > > > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > > > this.intercambiador > > > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > > > [0]; > > > > > > > } > > > > > > > }); > > > > > > [...] > > > > > > > this.initialize has no properties prototype.js (line 37) > > > > > > > Can you point me where is the error, please? > > > > > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > > > > > Specifically "Changes to the Class API". > > > > > > > > andhttp://prototypejs.org/learn/class-inheritancefora tutorial on > > > > > the whole thing. > > > > > > getElementsByClassName is a deprecated method. > > > > > > Can you try this ... > > > > > > var NodoYanged = Class.create({ > > > initialize: function(objeto, padre) { > > > this.padre = padre; > > > this.objeto = objeto; > > > this.tipo = objeto.select(''.Tipo'').first(); > > > this.texto = objeto.select(''.Texto'').first(); > > > this.intercambiador = objeto.select(''.Intercambiador'').first(); > > > this.contenido = objeto.select(''.Contenidos'').first(); > > > } > > > > > > });This is the best I can come up with ... <html> <head> <title>Test NodoYanged</title> <script type="text/javascript" src="http://prototypejs.org/assets/2007/10/16/prototype.js"></script> <script type="text/javascript"> var NodoYanged = Class.create({ initialize: function(objeto, padre) { this.padre = padre; this.objeto = objeto; this.tipo = objeto.select(''.Tipo'').first(); this.texto = objeto.select(''.Texto'').first(); this.intercambiador = objeto.select(''.Intercambiador'').first(); this.contenido = objeto.select(''.Contenidos'').first(); } }); document.observe(''dom:loaded'', function(){ o_Nodo = new NodoYanged($(''body''), $(''body'')); console.info(o_Nodo); }); </script> </head> <body id="body"> <div class="Tipo">Tipo</div> <div class="Texto">Texto</div> <div class="Intercambiador">Intercambiador</div> <div class="Contenidos">Contenidos</div> </body> </html> Notice how I don''t try to create the o_Nodo until the dom is loaded? Without it, I get the same sort of message you are presenting. Using FireBug, the console will show the o_Nodo with its properties. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I''ll try, please, ask if I don''t point you correctly (and sorry if that) I try this code: var NodoYanged = Class.create({ initialize: function(objeto) { // this.padre = padre; this.objeto = objeto; /* this.tipo = objeto.select(''Tipo'').first(); this.texto = objeto.select(''Texto'').first(); this.intercambiador = objeto.select(''Intercambiador'').first(); this.contenido = objeto.select(''Contenidos'').first(); */ } }); Note that I comment the most part of the constructor to try to isolate the error Then I try to create the node without success (the same error) with: Event.observe(window, ''load'', function() { var ArbolYanged = new NodoYanged($$(''#Contenido dl'').first()); }); But if I do this: Event.observe(window, ''load'', function() { alert($$(''#Contenido dl'').first().innerHTML); }); the content of #Contenido dl is alerted correctly What do you think about? Thanks! On Oct 31, 4:42 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Can you give more of a context? Live page? As the class requires 2 > parameters, they will need to be supplied in some fashion. > > Also, as they are accessing the DOM, you will need to make sure that > the DOM is loaded before you try to create an instance of this class. > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Sorry Richard but with your modification the error is raised like with > > the other version > > > Any clue? > > > Thanks! > > > On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi Gregory, hi Richard! > > > > For Greg (may I call you Greg?) In the new version of prototye (you > > > > could se the tutorial in the second link from Richard) you could find > > > > the new way to create a class > > > > > For Richard: sure I use the tutorial to create the class did you see > > > > any error? > > > > > Thanks! > > > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > wrote: > > > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > > > Hi! > > > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > > > here without lucky > > > > > > > > I try to create a class called NodoYanged like this: > > > > > > > > var NodoYanged = Class.create({ > > > > > > > initialize: function(objeto, padre) { > > > > > > > this.padre = padre; > > > > > > > this.objeto = objeto; > > > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > > > this.intercambiador > > > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > > > [0]; > > > > > > > } > > > > > > > }); > > > > > > [...] > > > > > > > this.initialize has no properties prototype.js (line 37) > > > > > > > Can you point me where is the error, please? > > > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > > > Specifically "Changes to the Class API". > > > > > > andhttp://prototypejs.org/learn/class-inheritanceforatutorial on > > > > > the whole thing. > > > > getElementsByClassName is a deprecated method. > > > > Can you try this ... > > > > var NodoYanged = Class.create({ > > > initialize: function(objeto, padre) { > > > this.padre = padre; > > > this.objeto = objeto; > > > this.tipo = objeto.select(''.Tipo'').first(); > > > this.texto = objeto.select(''.Texto'').first(); > > > this.intercambiador = objeto.select(''.Intercambiador'').first(); > > > this.contenido = objeto.select(''.Contenidos'').first(); > > > } > > > > }); > > > > -- > > > ----- > > > Richard Quadling > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > "Standing on the shoulders of some very clever giants!" > > -- > ----- > Richard Quadling > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > "Standing on the shoulders of some very clever giants!"--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
More tests If I try the preferred way example at http://www.prototypejs.org/learn/class-inheritance the same error is raised Perhaps is a bug? Meanwhile is better to use the old version? Thanks! On Oct 31, 4:59 pm, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ll try, please, ask if I don''t point you correctly (and sorry if > that) > > I try this code: > > var NodoYanged = Class.create({ > initialize: function(objeto) { > // this.padre = padre; > this.objeto = objeto; > /* this.tipo = objeto.select(''Tipo'').first(); > this.texto = objeto.select(''Texto'').first(); > this.intercambiador = objeto.select(''Intercambiador'').first(); > this.contenido = objeto.select(''Contenidos'').first(); */ > } > > }); > > Note that I comment the most part of the constructor to try to isolate > the error > Then I try to create the node without success (the same error) with: > > Event.observe(window, ''load'', function() { var ArbolYanged = new > NodoYanged($$(''#Contenido dl'').first()); }); > > But if I do this: > Event.observe(window, ''load'', function() { alert($$(''#Contenido > dl'').first().innerHTML); }); > > the content of #Contenido dl is alerted correctly > > What do you think about? > > Thanks! > > On Oct 31, 4:42 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > > Can you give more of a context? Live page? As the class requires 2 > > parameters, they will need to be supplied in some fashion. > > > Also, as they are accessing the DOM, you will need to make sure that > > the DOM is loaded before you try to create an instance of this class. > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Sorry Richard but with your modification the error is raised like with > > > the other version > > > > Any clue? > > > > Thanks! > > > > On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > wrote: > > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hi Gregory, hi Richard! > > > > > For Greg (may I call you Greg?) In the new version of prototye (you > > > > > could se the tutorial in the second link from Richard) you could find > > > > > the new way to create a class > > > > > > For Richard: sure I use the tutorial to create the class did you see > > > > > any error? > > > > > > Thanks! > > > > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > > wrote: > > > > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > > > > Hi! > > > > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > > > > here without lucky > > > > > > > > > I try to create a class called NodoYanged like this: > > > > > > > > > var NodoYanged = Class.create({ > > > > > > > > initialize: function(objeto, padre) { > > > > > > > > this.padre = padre; > > > > > > > > this.objeto = objeto; > > > > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > > > > this.intercambiador > > > > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > > > > [0]; > > > > > > > > } > > > > > > > > }); > > > > > > > [...] > > > > > > > > this.initialize has no properties prototype.js (line 37) > > > > > > > > Can you point me where is the error, please? > > > > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > > > > Specifically "Changes to the Class API". > > > > > > > andhttp://prototypejs.org/learn/class-inheritanceforatutorialon > > > > > > the whole thing. > > > > > getElementsByClassName is a deprecated method. > > > > > Can you try this ... > > > > > var NodoYanged = Class.create({ > > > > initialize: function(objeto, padre) { > > > > this.padre = padre; > > > > this.objeto = objeto; > > > > this.tipo = objeto.select(''.Tipo'').first(); > > > > this.texto = objeto.select(''.Texto'').first(); > > > > this.intercambiador = objeto.select(''.Intercambiador'').first(); > > > > this.contenido = objeto.select(''.Contenidos'').first(); > > > > } > > > > > }); > > > > > -- > > > > ----- > > > > Richard Quadling > > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > > "Standing on the shoulders of some very clever giants!" > > > -- > > ----- > > Richard Quadling > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > "Standing on the shoulders of some very clever giants!"--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
forget this threat the problem was the cache the server serve prototype 1.5 cached instead of the new one (1.6 ) Thanks a lot and sorry for the inconvenience On Oct 31, 5:49 pm, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> More tests > If I try the preferred way example athttp://www.prototypejs.org/learn/class-inheritance > the same error is raised > > Perhaps is a bug? > Meanwhile is better to use the old version? > > Thanks! > > On Oct 31, 4:59 pm, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''ll try, please, ask if I don''t point you correctly (and sorry if > > that) > > > I try this code: > > > var NodoYanged = Class.create({ > > initialize: function(objeto) { > > // this.padre = padre; > > this.objeto = objeto; > > /* this.tipo = objeto.select(''Tipo'').first(); > > this.texto = objeto.select(''Texto'').first(); > > this.intercambiador = objeto.select(''Intercambiador'').first(); > > this.contenido = objeto.select(''Contenidos'').first(); */ > > } > > > }); > > > Note that I comment the most part of the constructor to try to isolate > > the error > > Then I try to create the node without success (the same error) with: > > > Event.observe(window, ''load'', function() { var ArbolYanged = new > > NodoYanged($$(''#Contenido dl'').first()); }); > > > But if I do this: > > Event.observe(window, ''load'', function() { alert($$(''#Contenido > > dl'').first().innerHTML); }); > > > the content of #Contenido dl is alerted correctly > > > What do you think about? > > > Thanks! > > > On Oct 31, 4:42 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > > Can you give more of a context? Live page? As the class requires 2 > > > parameters, they will need to be supplied in some fashion. > > > > Also, as they are accessing the DOM, you will need to make sure that > > > the DOM is loaded before you try to create an instance of this class. > > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Sorry Richard but with your modification the error is raised like with > > > > the other version > > > > > Any clue? > > > > > Thanks! > > > > > On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > wrote: > > > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hi Gregory, hi Richard! > > > > > > For Greg (may I call you Greg?) In the new version of prototye (you > > > > > > could se the tutorial in the second link from Richard) you could find > > > > > > the new way to create a class > > > > > > > For Richard: sure I use the tutorial to create the class did you see > > > > > > any error? > > > > > > > Thanks! > > > > > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > > > wrote: > > > > > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > > > > > Hi! > > > > > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > > > > > here without lucky > > > > > > > > > > I try to create a class called NodoYanged like this: > > > > > > > > > > var NodoYanged = Class.create({ > > > > > > > > > initialize: function(objeto, padre) { > > > > > > > > > this.padre = padre; > > > > > > > > > this.objeto = objeto; > > > > > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > > > > > this.intercambiador > > > > > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > > > > > [0]; > > > > > > > > > } > > > > > > > > > }); > > > > > > > > [...] > > > > > > > > > this.initialize has no properties prototype.js (line 37) > > > > > > > > > Can you point me where is the error, please? > > > > > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > > > > > Specifically "Changes to the Class API". > > > > > > > > andhttp://prototypejs.org/learn/class-inheritanceforatutorialon > > > > > > > the whole thing. > > > > > > getElementsByClassName is a deprecated method. > > > > > > Can you try this ... > > > > > > var NodoYanged = Class.create({ > > > > > initialize: function(objeto, padre) { > > > > > this.padre = padre; > > > > > this.objeto = objeto; > > > > > this.tipo = objeto.select(''.Tipo'').first(); > > > > > this.texto = objeto.select(''.Texto'').first(); > > > > > this.intercambiador = objeto.select(''.Intercambiador'').first(); > > > > > this.contenido = objeto.select(''.Contenidos'').first(); > > > > > } > > > > > > }); > > > > > > -- > > > > > ----- > > > > > Richard Quadling > > > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > > > "Standing on the shoulders of some very clever giants!" > > > > -- > > > ----- > > > Richard Quadling > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > "Standing on the shoulders of some very clever giants!"--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Forget this threat! The problem was the cache... I think prototype 1.6 is on the way but the server serves 1.5 Sorry for the inconvenience! Thanks a lot On Oct 31, 5:49 pm, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> More tests > If I try the preferred way example athttp://www.prototypejs.org/learn/class-inheritance > the same error is raised > > Perhaps is a bug? > Meanwhile is better to use the old version? > > Thanks! > > On Oct 31, 4:59 pm, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''ll try, please, ask if I don''t point you correctly (and sorry if > > that) > > > I try this code: > > > var NodoYanged = Class.create({ > > initialize: function(objeto) { > > // this.padre = padre; > > this.objeto = objeto; > > /* this.tipo = objeto.select(''Tipo'').first(); > > this.texto = objeto.select(''Texto'').first(); > > this.intercambiador = objeto.select(''Intercambiador'').first(); > > this.contenido = objeto.select(''Contenidos'').first(); */ > > } > > > }); > > > Note that I comment the most part of the constructor to try to isolate > > the error > > Then I try to create the node without success (the same error) with: > > > Event.observe(window, ''load'', function() { var ArbolYanged = new > > NodoYanged($$(''#Contenido dl'').first()); }); > > > But if I do this: > > Event.observe(window, ''load'', function() { alert($$(''#Contenido > > dl'').first().innerHTML); }); > > > the content of #Contenido dl is alerted correctly > > > What do you think about? > > > Thanks! > > > On Oct 31, 4:42 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > > Can you give more of a context? Live page? As the class requires 2 > > > parameters, they will need to be supplied in some fashion. > > > > Also, as they are accessing the DOM, you will need to make sure that > > > the DOM is loaded before you try to create an instance of this class. > > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Sorry Richard but with your modification the error is raised like with > > > > the other version > > > > > Any clue? > > > > > Thanks! > > > > > On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > wrote: > > > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hi Gregory, hi Richard! > > > > > > For Greg (may I call you Greg?) In the new version of prototye (you > > > > > > could se the tutorial in the second link from Richard) you could find > > > > > > the new way to create a class > > > > > > > For Richard: sure I use the tutorial to create the class did you see > > > > > > any error? > > > > > > > Thanks! > > > > > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > > > wrote: > > > > > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > > > > > Hi! > > > > > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > > > > > here without lucky > > > > > > > > > > I try to create a class called NodoYanged like this: > > > > > > > > > > var NodoYanged = Class.create({ > > > > > > > > > initialize: function(objeto, padre) { > > > > > > > > > this.padre = padre; > > > > > > > > > this.objeto = objeto; > > > > > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > > > > > this.intercambiador > > > > > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > > > > > [0]; > > > > > > > > > } > > > > > > > > > }); > > > > > > > > [...] > > > > > > > > > this.initialize has no properties prototype.js (line 37) > > > > > > > > > Can you point me where is the error, please? > > > > > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > > > > > Specifically "Changes to the Class API". > > > > > > > > andhttp://prototypejs.org/learn/class-inheritanceforatutorialon > > > > > > > the whole thing. > > > > > > getElementsByClassName is a deprecated method. > > > > > > Can you try this ... > > > > > > var NodoYanged = Class.create({ > > > > > initialize: function(objeto, padre) { > > > > > this.padre = padre; > > > > > this.objeto = objeto; > > > > > this.tipo = objeto.select(''.Tipo'').first(); > > > > > this.texto = objeto.select(''.Texto'').first(); > > > > > this.intercambiador = objeto.select(''.Intercambiador'').first(); > > > > > this.contenido = objeto.select(''.Contenidos'').first(); > > > > > } > > > > > > }); > > > > > > -- > > > > > ----- > > > > > Richard Quadling > > > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > > > "Standing on the shoulders of some very clever giants!" > > > > -- > > > ----- > > > Richard Quadling > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > "Standing on the shoulders of some very clever giants!"--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 31/10/2007, Garito <garito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Forget this threat! > The problem was the cache... > > I think prototype 1.6 is on the way but the server serves 1.5 > > Sorry for the inconvenience! > > Thanks a lot > > On Oct 31, 5:49 pm, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > More tests > > If I try the preferred way example athttp://www.prototypejs.org/learn/class-inheritance > > the same error is raised > > > > Perhaps is a bug? > > Meanwhile is better to use the old version? > > > > Thanks! > > > > On Oct 31, 4:59 pm, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''ll try, please, ask if I don''t point you correctly (and sorry if > > > that) > > > > > I try this code: > > > > > var NodoYanged = Class.create({ > > > initialize: function(objeto) { > > > // this.padre = padre; > > > this.objeto = objeto; > > > /* this.tipo = objeto.select(''Tipo'').first(); > > > this.texto = objeto.select(''Texto'').first(); > > > this.intercambiador = objeto.select(''Intercambiador'').first(); > > > this.contenido = objeto.select(''Contenidos'').first(); */ > > > } > > > > > }); > > > > > Note that I comment the most part of the constructor to try to isolate > > > the error > > > Then I try to create the node without success (the same error) with: > > > > > Event.observe(window, ''load'', function() { var ArbolYanged = new > > > NodoYanged($$(''#Contenido dl'').first()); }); > > > > > But if I do this: > > > Event.observe(window, ''load'', function() { alert($$(''#Contenido > > > dl'').first().innerHTML); }); > > > > > the content of #Contenido dl is alerted correctly > > > > > What do you think about? > > > > > Thanks! > > > > > On Oct 31, 4:42 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > wrote: > > > > > > Can you give more of a context? Live page? As the class requires 2 > > > > parameters, they will need to be supplied in some fashion. > > > > > > Also, as they are accessing the DOM, you will need to make sure that > > > > the DOM is loaded before you try to create an instance of this class. > > > > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Sorry Richard but with your modification the error is raised like with > > > > > the other version > > > > > > > Any clue? > > > > > > > Thanks! > > > > > > > On Oct 31, 4:08 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > > wrote: > > > > > > On 31/10/2007, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Hi Gregory, hi Richard! > > > > > > > For Greg (may I call you Greg?) In the new version of prototye (you > > > > > > > could se the tutorial in the second link from Richard) you could find > > > > > > > the new way to create a class > > > > > > > > > For Richard: sure I use the tutorial to create the class did you see > > > > > > > any error? > > > > > > > > > Thanks! > > > > > > > > > On Oct 31, 3:39 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > > > > > wrote: > > > > > > > > On 31/10/2007, Gregory Seidman <gsslist+protot...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@public.gmane.org> wrote: > > > > > > > > > > > On Wed, Oct 31, 2007 at 05:16:18AM -0000, Garito wrote: > > > > > > > > > > > > Hi! > > > > > > > > > > Sorry if my question is a newbie one but I try to google before ask > > > > > > > > > > here without lucky > > > > > > > > > > > > I try to create a class called NodoYanged like this: > > > > > > > > > > > > var NodoYanged = Class.create({ > > > > > > > > > > initialize: function(objeto, padre) { > > > > > > > > > > this.padre = padre; > > > > > > > > > > this.objeto = objeto; > > > > > > > > > > this.tipo = this.objeto.getElementsByClassName(''Tipo'')[0]; > > > > > > > > > > this.texto = this.objeto.getElementsByClassName(''Texto'')[0]; > > > > > > > > > > this.intercambiador > > > > > > > > > > this.objeto.getElementsByClassName(''Intercambiador'')[0]; > > > > > > > > > > this.contenido = this.objeto.getElementsByClassName(''Contenidos'') > > > > > > > > > > [0]; > > > > > > > > > > } > > > > > > > > > > }); > > > > > > > > > [...] > > > > > > > > > > this.initialize has no properties prototype.js (line 37) > > > > > > > > > > Can you point me where is the error, please? > > > > > > > > > > > Class.create doesn''t take any arguments (at least in 1.5.0, I may be > > > > > > > > > behind). You need to Object.extend(NodoYanged.prototype, { ... }). > > > > > > > > > > I would take a serious look athttp://prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-... > > > > > > > > > > Specifically "Changes to the Class API". > > > > > > > > > > andhttp://prototypejs.org/learn/class-inheritanceforatutorialon > > > > > > > > the whole thing. > > > > > > > > getElementsByClassName is a deprecated method. > > > > > > > > Can you try this ... > > > > > > > > var NodoYanged = Class.create({ > > > > > > initialize: function(objeto, padre) { > > > > > > this.padre = padre; > > > > > > this.objeto = objeto; > > > > > > this.tipo = objeto.select(''.Tipo'').first(); > > > > > > this.texto = objeto.select(''.Texto'').first(); > > > > > > this.intercambiador = objeto.select(''.Intercambiador'').first(); > > > > > > this.contenido = objeto.select(''.Contenidos'').first(); > > > > > > } > > > > > > > > });Ha. That happens. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---