Make ajaxed content live, reinitiate functions

linus

New Member
The site contains a nav that steps users through a process and uses .get() to pull in the needed content for each step. Inside each step content there are various js functions like Flexslider, some Foundation functions and some click functions which are set earlier and initiated within the .get(). Simplified js:\[code\]function clickListener(){$('.container').on("click", ".pull-link", function(){ var action = $(this).attr('action'); var baseUrl = window.location.host; $.get('http://' + baseUrl + '/design/' + action,function(data){ $('.pull-content').html(data); //initiate functions after content loaded if($('#red').length > 0) { initRed(); } else if($('#blue').length > 0){ initBlue(); } }});}\[/code\]The flexslider initiation works fine but the click ones don't. Also, I would like to be able to put .pull-links inside the ajaxed in content. Is that possible or do I need another function? How do I make the ajaxed content 'live'?
 
Back
Top