I am working creating an app and i notice that when i try to include ajax code in my work its not working...and this same code is working for the video tutorial am learning from it happened in two different video tutorials wen i get to anything relating to ajax.. and its quiet frustrating.. this i my code below.
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="col-lg-10 col-md-10 col-sm-8 col-xs-6">
<div class="row">
<h3 class="panel-title">Book List</h3>
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<div class="row" align="right">
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 table-responsive">
<table id="book-table" class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Book Title</th>
<th>Book Price</th>
<th>Book Author</th>
<th>Rating</th>
<th>Publisher</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#book-table').DataTable({
"ajax":{
url: "<?php echo site_url("books/books_page") ?>",
type: 'GET'
},
});
});
</script>
this is the error am getting wen i try to inspect it using google chrome developer tools
from console the url is wrong, put it as below:
url: "<?php echo site_url("/books/books_page") ?>",
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments