Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ad Pro

macrumors member
Original poster
Jul 4, 2007
86
0
UK
I am having difficulty getting mootools Accordion and mootools Request.html to work on the same page. They both work individually but not together. I presume there is a clash somewhere.

Thanks in advance for any help.
 
Here is the code which I am trying to get to working:

View attachment site.zip

The accordion works, but the mootools request.html only works on its own - if I remove the accordion js (or the link to the accordion.js file)
 
In accordion.js on line 26 you have
PHP:
//add click event to the "add section" link
$('add_section').addEvent('click', function(event) {
but I don't see anything in your source with 'add_section' and believe that's why it's getting an error currently. There's only one link in the source and looks like,
HTML:
<a href="#" id="makeRequest">Load text</a>
 
Sorry, I left that bit in there by accident. I have taken it out now, but it still doesn't work.

View attachment 168880

Well you still have that bit of JavaScript that I listed earlier, it's what's giving the error in Error Console. When I comment it out there's no more errors.

The link for the request doesn't work, but that's because I'm running it locally and AJAX only works properly when on the server. So I can't really test that part out too much. Nothing in the code stands out as an obvious issue to me though.
 
Ooops, so i did.

Thanks - It works perfectly now. Thanks so much for your help!!


May I ask what Software you are using / how you are checking for errors in the code ?
 
May I ask what Software you are using / how you are checking for errors in the code ?

Firefox is my main browser and under the Tools menu there's an option for Error Console (Safari has this as well as most browsers do). I also use the Console^2 add-on, which makes it slightly more powerful. That's all I used here, but I also use the Web Developer Toolbar add-on frequently when helping on this type of problem as well as Firebug.
 
Firefox is my main browser and under the Tools menu there's an option for Error Console (Safari has this as well as most browsers do). I also use the Console^2 add-on, which makes it slightly more powerful. That's all I used here, but I also use the Web Developer Toolbar add-on frequently when helping on this type of problem as well as Firebug.

awesome, I will look further into this, think It will come in useful in the future. Thanks again.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.