Results 1 to 4 of 4

Thread: Two javascripts using jQuery?

  1. #1
    Join Date
    Feb 2008
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Two javascripts using jQuery?

    1) Script Title: Facebox image and content viewer (v 1.1) & Accordion Content script (v1.5.1)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ebox/index.htm & http://www.dynamicdrive.com/dynamici...daccordion.htm

    3) Describe problem: Hello! I am trying to use the Facebox image and content viewer on the same page as the Accordian Content script. Both reference jQuery. Each works fine when the other is taken off the page. I found a thread about jQuery conflicting with Prototype. The solution described was to change all the variables $ to $j. I tried the steps listed in the other thread, but I couldn't get it to work. I am not very familiar with javascript, so sorry if this is an obvious question.


    *Note: Sorry, I just read that this type of question is NOT generally supported in this forum.
    Last edited by Bribunk; 07-30-2008 at 12:14 AM.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Actually, if you're using the latest version of Accordion Content script (v1.5+), it will work with other jQuery scripts on the same page without any changes to the "$" function. I just tried adding the two scripts onto a blank page, and both run together without problems.

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Bribunk (07-30-2008)

  4. #3
    Join Date
    Feb 2008
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much for your reply. I tried implementing these two scripts on a blank page, like you did, and I eventually got them to work. I don't think facebox liked to work when I moved jQuery out of the facefile directory. I appreciated your help!

  5. #4
    Join Date
    Sep 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Jquery with .asp include pages

    If anyone is using the JQuery .js on the same page but are having trouble using an .asp include file...it is an easy solution.


    Place the JQuery.js file on the main page that you have your two elements.
    (ie. <script type="text/javascript" src="jquery-1.2.2.pack.js"></script> )

    Place the .js that is on the main page below this.
    (ie. <script type="text/javascript" src="animatedcollapse.js"></script>

    For the dynamic content that is on the .asp include page use ONLY the script for the effect you are trying to get.
    (ie. <script type="text/javascript" src="ddaccordion.js"></script>

    DO NOT re-use the jquery script above on the .asp include file. This will attempt to load the file twice and the first instance of the file will take precedence. It should only be on the page once.

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
  •