• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
debugbar is breaking my JSON?

#1
Question 
I'm trying to retrieve data for my calendar but for some reason I get this response
Code:
[{"title":"aaa22","start":"2021-04-01","end":"2021-04-01","id":"4"},{"title":"aaaeeee","start":"2021-03-30","end":"2021-03-30","id":"48"},{"title":"beep boop","start":"2021-03-31","end":"2021-03-31","id":"54"},{"title":"lorem ipsum edit","start":"2021-04-06","end":"2021-04-06","id":"55"}]
<script type="text/javascript"  id="debugbar_loader" data-time="1618658976" src="localhost/myapp/?debugbar"></script><script type="text/javascript"  id="debugbar_dynamic_script"></script><style type="text/css"  id="debugbar_dynamic_style"></style>
I have no idea how the <script> is getting there but it's causing a JSON Parse error on my view file.

Controller:

PHP Code:
    function get_activities()
    {
        
$data['start'] = $this->request->getGet('start');
        
$data['end'] = $this->request->getGet('end');
        
$activities $this->Calendar_model->get_activities($data);
        echo 
json_encode($activities);
    } 



Model:
PHP Code:
  function get_activities($data)
  {
    $builder $this->db->table('calendar');
    $builder->where('start >='$data['start']);
    $builder->where('end <='$data['end']);
    return $builder->get()->getResultArray();
  
Reply

#2
app/Config/Boot/development.php

CI_DEBUG = false;
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(04-17-2021, 12:04 PM)InsiteFX Wrote: app/Config/Boot/development.php

CI_DEBUG = false;
Yup, that fixed it. Thanks!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.