Results 1 to 2 of 2

Thread: Can I combine two scripts into one?

  1. #1
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can I combine two scripts into one?

    1) Script Title: Bullet List Accordion Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...enu-bullet.htm

    3) Describe problem: I am trying to use your scripts and menu pattern in a page where I am currently limited to pulling in two scripts. Is it possible to combine ddaccordion.js and jquery-1.2.2.pack.js into one file and still have the scripting work for the menu?

    I am also going to try to figure out how to gain permission to use more than two scripts, but if I can combine these, I should be able to fix my issues more quickly.

    I really like how this menu looks and works for me, and would be disappointed if I could not use it after all!

    Thank you for your assistance!
    Margretta de Vries

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't see why not, though I may be missing something. Here's what I'd do:

    Using a text only editor like NotePad, open up both scripts. Make sure word wrap is off for both files. Now, the jquery-1.2.2.pack.js code would probably need to come before the ddaccordion.js code, so I would add a few blank lines at the end of the jquery-1.2.2.pack.js file, and then copy and paste the entire contents of the ddaccordion.js file to the bottom of the jquery-1.2.2.pack.js file. Save it as - say:

    ddaccordion_with_jquery-1.2.2.pack.js

    Then you would need just one external script call for it on your page, replace:

    Code:
    <script type="text/javascript" src="jquery-1.2.2.pack.js"></script>
    
    <script type="text/javascript" src="ddaccordion.js">
    
    /***********************************************
    * Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    </script>
    with:

    Code:
    <script type="text/javascript" src="ddaccordion_with_jquery-1.2.2.pack.js">
    
    /***********************************************
    * Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •