I've created a page where i use the onclick load function to load a php file into a div. Now I want to load another file into another div from the file i imported before.
So for example:
[ Category 1 | Category 2 | Category 3 | Category 4]
[ here got file 1 imported from a pressed Category which contains a href] [Here is the second div which will import another file from the href which is clicked from the first imported file]
Somehow, I cant get it working for the second import. First import works. I use the same code from the first import for the second import (just other id's (#)).
Part of First file to import:
<li ><a href="#" id="campaign" >Campaign</a ></li >
<li ><a href="#" id="resources" >Resources</a ></li >
<li ><a href="#" id="gang" >Gang</a ></li >
<li ><a href="#" id="gambling" >Gambling</a ></li >
<li ><a href="#" id="off-topic" >Off-Topic</a ></li >
<script >
$(document).ready(function () {
// Forum categories
$("#campaign").on("click", function () {
$("#main").load("forum/campaign.php");
});
$("#resources").on("click", function () {
$("#main").load("forum/resources.php");
});
$("#gang").on("click", function () {
$("#main").load("forum/gang.php");
});
$("#gambling").on("click", function () {
$("#main").load("forum/gambling.php");
});
$("#off-topic").on("click", function () {
$("#main").load("forum/off-topic.php");
});
});
</script >
Part of Second file to import:
<a href="#" class="list-group-item small" id="message" style="background-color:black; color:white;" ><span class="glyphicon glyphicon-pushpin" aria-hidden="true" ></span > | <?php echo $sticky['header']; ?> </a >
<script >
$(document).ready(function () {
// Forum categories
$("#message").on("click", function () {
$("#getmessage").load("forum/getmessage.php");
});
</script >