I’m currently developing a small snippet that changes the CSS without reloading the page, using the prototype library. My problem is that the snippet fails when it’s on the same page along with MaxiGallery, which also uses the Prototype library. I added a parameter to specify if the prototype file should be included or not, but since I’m putting my snippet inside a template and that MaxiGallery uses the same template but is not on every page, it sometimes work, sometimes don’t.
So, in short, I’m wondering if somebody has any suggestion regarding the issue of js libs. Anyone has a best way of handling this?
I hope I’m clear, and thanks in advance for your suggestions.
MaxiGallery has &disable_js_libs parameter what you can use to make it not add prototype/scriptaculous libraries to the web page.. see
http://wiki.modxcms.com/index.php/MaxiGallery for more information.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
yea, there is no fix for it really.. other than if there would be a common place for the js libs and some naming standards (eg. different versions of the libs).. then it would be possible for the regClientxxx functions to check that one script isn’t included twice. It’s not possible to just not include scripts if they are the same name, because the content can still be different (different versions etc..) and comparing the two files to see if they are same is too heavy, unless if the compare results would be cached someway then.. in any case, I haven’t heard any plans for this "issue".
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Al’right, thanks for your help doze.