MDWeezer Posted August 22, 2007 Share Posted August 22, 2007 I have a very simple site (internal to my employer, otherwise I would post the site). It's a simple grid layout and on my left hand column I have a list box containing some items. When an item is selected, an AJAX call is made to populate the main content with an accordion containing data regarding that item. However, after a few selections from the list the accordion starts to not function properly (everything expands when clicked, only opens half way etc etc). Pages that I use the same accordion code on that don't have any AJAX calls function fine, so the AJAX calls are doing something. Here's my code (Prototype for my AJAX calls): AJAX Call: function getLRUs(selected_value){ var url = 'getlrus.cfm'; var pars = 'id='+selected_value; var target = 'mainBox'; var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars, asynchronous:true, evalScripts: true}); initLightbox(); } Then I have to use an iframe inside of the returned contents to fire off the code to render my accordion which looks like this: <iframe WIDTH=0 HEIGHT=0 FRAMEBORDER=0 onload="init();"/> init() is in an included javascipt file. function init() { new Accordian('basic-accordian',5,'header_highlight'); } Once I close out of my browser (IE in my corporations case...) and open it back up it will function correctly. I'm guessing as I make each AJAX request, I'm creating more and more accordion objects? Any thoughts or suggestions? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.