This provides a huge dilemma:
- We need Dojo, especially parts of dojox, for pretty interface and graphics drawing; a lot of work has already been put in.
- We need Prototype for RJS and AJAX in an already well-established Rails project.
It came to me in the shower: iframes. The fundamental problem is that we can't load both Dojo and Prototype in the same page without consequences in our Dojo graphics code. But what if we loaded an iframe that only had Dojo references into a Rails page which had Prototype loaded. It works! At least in Safari and Firefox, our main development platforms, the competing javascripts are kept separate. I haven't tested in IE.
I realize this isn't the ideal solution people want to hear. But in the end, communication between pages/iframes with separate javascript technologies is a much easier problem to deal with than getting two complex javascript technologies to function together in the same page.
UPDATE 1 (10/22/08)
Actually, I'm now an advocate of using the object tag as opposed to the iframe tag. It validates as valid xhtml 1.1, strict, with the same effect. It also sounds better than using frames.
0 comments:
Post a Comment