Sometimes people can use global variables in their packed javascript. If you have two packages that use the same global variable, then obviously there will be problems. To solve this problem, try creating a closure of each package code. Without seeing the code, I am not 100% to make it work, but here is an example:
var textTitle = "Image gallery";
function getGalleryTitle() { return textTitle; }
var textTitle = "Watermark";
alert(getGalleryTitle());
Now with a closure created using anonymous functions:
(function() {
var textTitle = "Image gallery";
function getGalleryTitle() {
return textTitle;
}
})();
(function() {
var textTitle = "Watermark";
})();
The disadvantage is that you can no longer access these variables and functions globally (for example, through the built-in event handlers).
source
share