![]() |
<Header> problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: <Header> problem (/showthread.php?tid=12666) |
<Header> problem - El Forum - 10-27-2008 [eluser]dimis[/eluser] I have this problem. I have a controler and at constructor I set the view of the header Code: $this->data['header'] = $this->load->view('main/header', $this->data, TRUE); Code: $this->data['myjs']="include js file"; Code: <?php echo $myjs ?> What is wrong? Maybe I have to initialize $this->data['myjs'] before header view but I want this script only at this function. Is there a solution to write it at header? <Header> problem - El Forum - 10-27-2008 [eluser]beemr[/eluser] For javascript, it is actually fastest to load it just before you close the body tag. Reason is that javascript hangs the socket until it is loaded and run. Fortunately for you, solving for speed should also solve your view ordering. |