问题
I have a site that I am using prototype and scriptaculous on. One one page of my site, I would like to use Digitarald's FancyUploader (I have not found anything else that is as elegant, and offers multiple file selection). Is it possible to use the two on the same page? If so, how would I do it?
回答1:
There is no way to run a Mootools script with prototype.
While Mootools provide a dollar-safe mode, that mode only provided compatibility with frameworks that provides a $()
function.
The reason why Mootools and prototype are incompatible is that they both extend native JavaScript natives with their own methods. Unfortunately, there is no way of overriding this behavior.
SWFUpload is an alternative solution which is compatible with pretty much all JavaScript frameworks. It is pretty much functionally equivalent to FancyUpload. You might want to consider it as an alternative solution. If not, you'll have to make a choice between Mootools and prototype.
来源:https://stackoverflow.com/questions/2180995/how-can-i-use-fancyupload-with-mootools-side-by-side-with-prototype-js