jquery ajax call: multiple links load data into one div
- by user1146939
I have a dynamically generated list of links. Each link will request a different page to load. Depending on the link clicked I want it to fill the div with an ajax .load call. The thing is I want all links to reset and fill the same div. I am having trouble doing this without making a seperate div for each link, which isn't what I'm looking for.
This is what I have so far, but only works with one link.
<a data-toggle="modal" href="#myModal">Link</a>
<div class="modal hide fade" id="myModal"></div>
<script type="text/javascript">
$(document).ready(function() {
$('#myModal').load('mypage.php');
});
</script>