I have an "index.php" page to display all posts from database in a LEFT div as follows:
<div class="col-md-6" id="left">
<a id="link" href="post.php?id=<?php echo $postid;?>"><?php echo $submsg;?></a>
</div>
Also, I have a RIGHT div on same page to expand post when user click on the post link to "read more, comment, like.." as follows:
<div class="col-md-6" id="right">
</div>
And I have a "post.php" page to load it into the RIGHT div..
And I have this Jquery script:
<script>
$("a#link").click(function(e){
e.preventDefault();
$('#right').load(this.getAttribute('href'));
});
</script>
Everything is fine but there's only one problem which is the href of the page is always "index.php" and I want it to changes into the post link when It display in the RIGHT div.
How can I do it?
Thanks in advance.