Call External Javascript function using Codeigniter
Posted
by Ajith
on Stack Overflow
See other posts from Stack Overflow
or by Ajith
Published on 2010-05-17T07:27:01Z
Indexed on
2010/05/17
7:30 UTC
Read the original article
Hit count: 453
codeigniter
Hi, I need to call a javascript function from my controller in codeigniter.It is possible in codeigniter ? Problem Details My javascript file contains ` function debugOutput(msg) { alert (msg); }
` and also I need to call it from my controller.
I done it as follows.
<?php
function check()
{
header('Content-type: application/x-javascript');
// body here
}
?>
function execute() {
debugOutput("<?php echo 'test'; ?>");
}
execute();
But it is not working.Please help me to solve it.
© Stack Overflow or respective owner