Dynamically loaded content via AJAX breaks loading jQuery objects.
-
I’m using the following code to load content onto the homepage when a section is clicked:
$.ajaxSetup ({ cache: false }); var ajax_load = "<center><img src='<?php bloginfo("template_url"); ?>/images/loading.gif' alt='Loading...' /></center>"; var loadUrl = "https://localhost:8888/cnNew/?portfolio=portfolio-test"; $("#ourTeam").click(function(){ $("#main") .html(ajax_load) .load(loadUrl + " #content"); });
The issue that i’m running into is with the content that’s being loaded.
Both sections of the loaded content are using jQuery in which neither work when it’s loaded in via Ajax (but work when going directly to the page).
Are the jQuery objects coming in broken because the .js files have already loaded?
Do I need to refresh the scripts somehow when the content is loaded?Thanks for the help!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Dynamically loaded content via AJAX breaks loading jQuery objects.’ is closed to new replies.