I need to reload a div on a page on click. So far I have this:
<div id="next"><a id="nextC" href="#">NEXT TESTIMONIAL</a></div><!-- END #next -->
And the js
$('#nextC').click(function(){
$('#atestimonial').load('/ #atestimonial');
evt.preventDefault();
});
I am using wordpress and I have a method sorted for pulling data into the div atestimonial. All I need to do is refresh it on click, doesnt matter about loading a page in.
Can this be done? All I want to do is refresh a div, nothing more.
What you are proposing is not possible with the page as you have currently designed. In order to have just that segment of the page reload, you will need to break out that div into a new URL that returns only the content you want plugged into that section.
Once that’s done, jQuery can reload just that section.