Javascript – Are Mootools and Google Closure Librarys Compatible


Anyone have any experience of using Closure js lib and Mootools in the same page?

Conflicts or works ok?

Best Solution

According to google:

The names of all Closure Library functions and properties begin with a dot-delimited path that prevents them from accidentally overlapping with names defined in non-Closure Library code. This path is called a namespace.


So there should be no conflicts, also I checked the API documentation and it reaffirms my findings, for example, for array manipulation you have to go through the google namespace (goog):

goog.array.binaryInsert(array, value, opt_compareFn)   ⇒

( This is unlike the MooTools extention of the Array class itself.

Cheers, Roman