Welcome Guest, Not a member yet? Register   Sign In
javascript in template header can be used by called views
#1

[eluser]gullah[/eluser]
Edit: I figured it out. For some reason the $ wasn't working in the views so using jQuery. works instead.

I am using the Template library to manage my views http://ellislab.com/forums/viewthread/95687/

I have run into a major problem. I want to call jquery and other javascript files from the template header and then use the libraries in the views which are rendered inside the main template file.

But... the javascript files called in the main template file are not useable for some reason by the view files. Any ideas?
Code:
$this->template->write('title', 'Viewing ' . $songId->song);
                    $this->template->write_view('content', 'songs/view', $data, true);
                    $this->template->render();

also tried
Code:
$view = $this->load->view('songs/view', $data);
                    $this->template->write('content', $view);
                    $this->template->render();

neither of which let me use the JS in the views.




Theme © iAndrew 2016 - Forum software by © MyBB