SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Conflicting Javascript Files (import libraries)

    Hi All,

    I am working on an osCommerce site and am in the process of customizing the product page. I added a contribution for image overlay (lightbox2) and now want to add a social bookmarking button (OSC Socializer).

    The problem is that the image overlay package uses "scriptaculous" while the social bookmarking button uses "mootools". Evidently there is some overlapping here as the image button does not work while the scriptaculous import statements are in the html head section. If I comment scriptaculous statements out, the social bookmarking button works fine.

    Here are my import statements.

    HTML Code:
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
    <script type="text/javascript" src="js/lightbox.js"></script>
    <script language="javascript" type="text/ecmascript" src="social/js/mootools-1.2-core.js"></script>
    <script language="javascript" type="text/ecmascript" src="social/js/socializer.js"></script>
    <link href="social/css/socializer.css" rel="stylesheet" type="text/css" />
    Is there any way I can do selective imports for either package directly within the body?

    Any ideas about a viable approach?

    Thanks!

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


  3. #3
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi and thanks for your response.

    The solution you reference is specific to jQuery's noConflict() method. The problem is that mootools and scriptaculous do not support this method.

    I was wondering if there was anyway to isolate particular pieces of the webpage to use a specific library.

    Any suggestions are appreciated.

    Thanks ...

  4. #4
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After further investigation, it does not appear that there is a way around this. jQuery's noConflict feature seems great, but I don't think that there is a way to make "scriptaculous" and "mootools" play nice.

    Decided to go with lightbox clone slimbox.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •