I am working on a module which contains two pages one being the product.php and the other being the filterproducts.php
Product.php contains a Div Element which gets loaded by the .load() present inside the product.php
<div id="limitpage">
</div>
The .load() function makes an ajax call and get the output from the filterproducts.php
Structure of product.php looks like this
<button id="nex" >clickme</button>
<div id="limitpage">
</div>
<script>
//Both of them are in document ready function
$('#nexus').on('click',function () {
alert("here");
});
$('#nex').click(function(){
$('#limitpage').load("filterproducts.php");
})
</script>
filterproducts.php contains a button
<button id="nexus">Next Page</button>
But ,when the page gets loaded on('click',function()) doesn't work.Why is this exactly happening? What is the workaround to do the same,if this one is not possible.