Welcome Guest, Not a member yet? Register   Sign In
Passing variable to external javascript file in uri
#1

[eluser]Bramme[/eluser]
Hey all

I'm messing around with javascript in a project (still learning a lot, i don't know much javascript). I'm putting all the js I have in an external file, to keep my page somewhat clean, but I've encountered an issue:

I would like to pass the base_url() to one of the external js files. Now I thought I once saw a js library use smth like "file.js?foo=bar", since I'm using the template library, I could very easily use
Code:
$this->template->add_js('assets/js/file.js?baseurl='.base_url());

I've googled this but didn't find anything that could really help me. Using baseurl in my file.js doesn't work either, that would've been too easy I guess :p


Messages In This Thread
Passing variable to external javascript file in uri - by El Forum - 04-11-2009, 10:08 AM
Passing variable to external javascript file in uri - by El Forum - 04-11-2009, 10:14 AM
Passing variable to external javascript file in uri - by El Forum - 04-11-2009, 10:33 AM
Passing variable to external javascript file in uri - by El Forum - 04-11-2009, 10:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB