I have spent hours reading and trying tutorials. I cant seem to find a solution that works and I know it should be pretty easy but I struggle with AJAX. :(
I want to
Barry's answer is correct about being able to load a partial page by adding a css selector expression to the end of the URL. However, there would need to be a space between the url and the selector like so:
$("#tabs").load(post_url + " .tabcontent" );
Otherwise the string passed to .load()
would be http://example.com.tabscontent
. But it should be http://example.com .tabscontent
.
Also, a word to the wise, using this method will stop jQuery from loading and executing any code inside tags. However, just using
.load(post_url);
without a selector would successfully load and execute code in tags.
Read more about that here.