[eluser]Dominiq[/eluser]
Hey I have problem with my js code that is in CI template. He runs two times instead of one time. This is my test example:
Code:
[removed]
$(document).ready(function() {
console.log('php');
});
[removed]
In firebug console I see this:
"js" is log from my js file. I was checking what will be executed first.
This part of js code is in template that is returned as a string:
Code:
$string = $this->load->view('myfile', '', true);
Then this $string is printed by echo in another template that is sent directly to browser:
Code:
$this->load->view('blogview', $data);
I don't have idea why it is like this. Maybe because template in template? Or because that I did retuned first template as string?