Ok, so I'm pretty new to ajax and loading content externally and would appreciate any insight to my problem.
I currently have a hidden div that is empty where the ajax content should load in after a link is clicked.
<div id="#ajax-wrap"></div>
I currently have a list of links that all have the same class and I'd like to have, when clicked, the blank div do a slide toggle and then load in the content from the page that the link was to.
Link:
<a href="always a different url" class="home-right"></a>
Current jQuery:
$("a.home-right").click(function () {
$('#ajax-wrap').slideToggle();
});
Being as I'm new to Ajax and loading the external content, I'd like to know how to load content from the linked page that's house in the #content
tag. So essentially, I'd like a .home-right
link, #ajax-wrap
would slide toggle, and then Ajax would pull content from the linked page (which is always going to be a different random link) and it's #content
div, placing that content in #ajax-wrap
.
Thanks in advance for any help folks!
try this:
You can simply use the
ajax
like this:Use get:
You want to set the
ajax
for the links. Requirements:#ajax-wrap
fresh.#ajax-wrap
.