最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Codeigniter controller, javascript console.log() - Stack Overflow

programmeradmin5浏览0评论

Is there a (simple) way to echo some variables from a Codeigniter controller to the browser console?

Something like

public function my_controller_method() {
   if (testing_out_something) {
      $result = "looks like it works";
      $this->log_to_javascript_console->write($result);
   }
}

I saw this javascript class but it looks like it's more for jQuery, I just want to do something simple for debugging purposes.

I guess another way would be to send it to a view, but I don't want my view to change at the moment, I just want to make sure my data is being sent.

Is there a (simple) way to echo some variables from a Codeigniter controller to the browser console?

Something like

public function my_controller_method() {
   if (testing_out_something) {
      $result = "looks like it works";
      $this->log_to_javascript_console->write($result);
   }
}

I saw this javascript class but it looks like it's more for jQuery, I just want to do something simple for debugging purposes.

I guess another way would be to send it to a view, but I don't want my view to change at the moment, I just want to make sure my data is being sent.

Share Improve this question asked Aug 17, 2012 at 12:45 redconservatoryredconservatory 22k41 gold badges122 silver badges193 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

this links may help you :

http://www.codeforest/debugging-php-in-browsers-javascript-console

http://sarfraznawaz.wordpress./2012/01/05/outputting-php-to-browser-console/

发布评论

评论列表(0)

  1. 暂无评论