Hi, I've been trying to do my javascript code "right", or at least more elegantly than a bunch of global variables and functions. That in mind, I am trying to use the Class system from Prototype. It's kind of alien to me, as it's got a few weird things that I'm not used to (being more used to the C++/Java models)
Basically I have a ship object that has some data, and that ship owns an object that represents that ships batteries (gun batteries). So a few things I'm not quite sure on. The first is having the object load itself. I had all sorts of problems on my first attempt - the method to load itself was calling Ajax.Request with an onSuccess method - when the onSuccess method fired, the anon function no longer had the right context (the owning Ship object).. I tried it another way (calling a method of the object) and that didn't work either. I had to break it out into a global function, which is far from ideal. What's the proper way to do that? --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
