Call External Javascript function using Codeigniter
- by Ajith
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.