Sapna Grover wrote: > Hello, We have a problem that is related to what is described on > http://prototypejs.org/api/array . > We have added prototype.js into our product and just adding it breaks > existing code which relies on associative arrays. > > When you say "associative arrays" I'm guessing you are referring to the harmful use of storing members as array properties. Andrew Dupont has a very concise article on this practice.
http://www.andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/ FTA: "Luckily, there is a dead-simple way to fix this. In the above example, you need only change |Array| to |Object|. (Or, if you're using literal syntax, change |[]| to |{}|.) There. Your wrong code is no longer wrong, and it took only a little more work than a simple find-and-replace." > We can change some of the arrays to follow the prototype syntax. > However, I m wondering whether there is a work around to this problem > especially because there is customer code that we can't change. Also > with porotype our application won't work in MashUps. > ... > I would request to the customer that they fix any incorrect usage of Array. Point them to Andrew's article even. If that doesn't work, you'll probably have to use a library that ignores incorrect usage of Array :( Best regards, Ken Snyder --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
