Welcome Guest, Not a member yet? Register   Sign In
Javascript integration in views
#4

[eluser]Michael Wales[/eluser]
I'm still not sure how that makes a difference - without seeing what your JS looked like - sounds to me to be some obtrusive coding. Personally, I'd take a look at my Javascript and figure out why it can't be shared across all pages.

But - if you want, you could do something like this within each controller:
Code:
$data['js_file'] = 'index.js';

Then in your header view:
Code:
script src="<?= base_url(); ?>assets/js/<?= $js_file; ?>" type="text/javascript"

By loading the header and footer from your page specific view you are automatically passing the $data array to those views (without even changing the load->view() method).


Messages In This Thread
Javascript integration in views - by El Forum - 05-23-2008, 01:54 AM
Javascript integration in views - by El Forum - 05-23-2008, 03:06 AM
Javascript integration in views - by El Forum - 05-23-2008, 03:10 AM
Javascript integration in views - by El Forum - 05-23-2008, 03:18 AM
Javascript integration in views - by El Forum - 05-23-2008, 03:42 AM
Javascript integration in views - by El Forum - 05-23-2008, 04:04 AM
Javascript integration in views - by El Forum - 05-23-2008, 04:11 AM
Javascript integration in views - by El Forum - 05-23-2008, 04:17 AM
Javascript integration in views - by El Forum - 05-23-2008, 04:24 AM
Javascript integration in views - by El Forum - 05-23-2008, 04:25 AM
Javascript integration in views - by El Forum - 05-23-2008, 04:33 AM
Javascript integration in views - by El Forum - 05-23-2008, 11:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB