We use Prototype in our projects when developing AJAX applications. We recently started a project with a customer that is porting their Flash-based product to one that is primarily driven from Mozilla’s XUL framework. XUL has an entire framework for building cross-platform UIs – it’s mostly only for Mozilla-based browsers, although others have tried to use the XUL spec to run in other browsers.
I was planning on leveraging the Prototype library – the same that we do in typical web applications. The basics worked fine – until we ran into a pretty trivial prototype requirement – AJAX requests. You gotta love fun errors like the following:
TypeError: this.transport.onreadystatechange.bind is not a function
Geez, thanks – that was very helpful.
After summoning google to do a little research for me, I found a year old post in a Ruby on Rails mailing list with someone having a similar problem. Luckily, I found a patched version of Prototype 1.4 that has all the fixes. Basically, in Mozilla there is a very old bug that doesn’t allow you to add new methods dynamically to Function or Regexp. [1],[2] This new patched Prototype will replace all the bind methods on objects with a new generic bind method that does that same job as an anonymous javascript function reference.
Download the XUL for Javascript fix
technorati tags: xul, prototype, javascript
[1] Mozilla Group Discussion
[2] Mozilla Group Discussion
Popularity: 9% [?]
Other popular articles you might enjoy:
If you enjoyed this post, make sure you subscribe to my RSS feed!