October 23, 200818 yr Hi... I'm stuck again I currently have a HTML page that uses AJAX to load content into a div. The parent html page uses jQuery. The problem I'm having is selecting objects within the dynamically loaded content (i.e loaded using with AJAX functions) from the parent page. Basically, I have an jQuery selector on the parent HTML page and I want to select a HTML div that is within the content that the AJAX function loaded. I'd be very grateful for help.
October 24, 200818 yr Author I'm guessing, from the lack of responses, that I haven't explained it very well... The HTML page loads the content of another file into a div, using AJAX. I have an anchor within that other file that's loaded, on which I want to apply a jQuery click event. The jQuery library is included in the parent head (i.e. the HTML page). The problem is that the parent jQuery functions to not seem to be able to see elements that are loaded dynamically. How can I get around this problem, as most of the site is loaded in this method.
October 27, 200818 yr Author I've realised what the problem was. I may as well post it as somebody in the world might one day be as stupid as me The jQuery declarations were in the 'document ready' section of the site so they're only called when the page is loaded. As the page is dynamically updated it's not covered by this.
November 18, 200817 yr Hey, you need to use a plugin like livequery by Brandon Aaron. It allows events to be bound to all elements whether they were loaded from html or loaded via ajax. Sameer
Create an account or sign in to comment