Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div data-role="navbar">
- <ul>
- <li><a href="<?php echo base_url();?>" data-icon="home" data-prefetch="true" data-transition="flip">HOME</a></li>
- <li><a href="<?php echo base_url();?>data/table" class="ui-btn-active" data-icon="bars" data-theme="c" data-prefetch="true" data-transition="turn" >Data</a></li>
- </ul>
- </div>
- <script>
- $(document).ready(function() {
- token= "<?php echo $this->session->userdata('token');?>";
- $(function(){
- $.ajaxSetup({
- type : "get",
- dataType : 'json',
- url : "<?php echo base_url();?>data/json",
- cache : false,
- });
- $.ajax({
- data : {token:token},
- success : function(data){
- var no=0;
- data.nama.forEach(function(obj){
- cetak = "<tr>";
- cetak += "<td>"+(no+1)+"</td>";
- cetak += "<td>"+data.nama[no]+"</td>";
- cetak += "<td>"+data.volume_air[no]+"</td>";
- if(data.relay[no]==1)
- cetak += "<td>Aktif</td>";
- if(data.relay[no]==0)
- cetak += "<td>Tidak Aktif</td>";
- cetak += "<td>"+data.waktu[no]+"</td>";
- cetak += "</tr>";
- $("#iot").append(cetak);
- no++;
- });
- console.log(data);
- }//END success
- })
- });
- });
- </script>
Add Comment
Please, Sign In to add comment