This may be a duplicate question but i can't solve this problem.
navbar.php:
<li id="create_user"><a href="#"><i class="fa fa-plus fa-lg"></i> <span>Create New User</span></a></li>
and in my main php file i enclude navbar.php as follow.
<html>
<?php $this->load->view("includes/headTag"); ?>
<body>
<!-- Main Container start -->
<!-- <div class="container main_container"> -->
<?php $this->load->view("includes/dashboard_navbar.php"); ?>
<?php $this->load->view("includes/sub_dashboard.php"); ?>
<?php $this->load->view("includes/main_dashboard.php"); ?>
<!-- load the contents from controller here -->
<?php $this->load->view($path); ?>
<?php $this->load->view("includes/footerScripts.php");?>
<!-- </div> -->
<!-- main container end -->
</body>
</html>
now using a test.js file i change the value of $path and load a new file. The problem is jquery events are not registered to file contents and html elments added dynamically.
I know about
$("parent-selecter").on("event","child-selecter",callback(){});
but here i'm totally confused what to do. Should i use something like
$("body").on("event","child-selecter",callback(){});
or?
Any help is appreciated