javascript - Why my page gives me 404 -
i create new controller in codeigniter:
class extends ci_controller{ public function up(){ $this->load->view('get_view.php'); } }
and view executes javascript operation:
<script src="/js/update.php" type="text/javascript"></script> <?php ?> <script> updatedb(); </script>
now modify routes in way:
$route['get']='get/up';
but when go link "localhost/get", gives me 404. can me?
make sure url helper autoloaded
your loading php in javascript think instead of update.php best update.js
then try
<script type="text/javascript" src="<?php echo base_url('assets/js/update.js');?>" ></script>
assets folder in main directory.
update:
make sure class , file names of models , controllers make sure first letter uppercase example welcome.php , not welcome.php
Comments
Post a Comment