I wrote an ajax code like this :
$.ajax({
type: "POST",
url: "post.php",
data: {id:id},
cache: false,
success: function (result) {
$('.post').html(result);
}
});
this code show more post in the index.php file , when it shows the more posts main.js file that embeded in the index.php not working on the new posts.
i used this code in the post.php :
<script src="main.js" ></script>
it worked but some of the function run two time.
how can i embed the main.js on the post.php without the above problem?