Welcome Guest, Not a member yet? Register   Sign In
Javascript + base_url()
#1

[eluser]ELRafael[/eluser]
Greetings....

Here's my doubt.

i have a javascript file (global.js) that loads into view. (script src="....")

so far so good. but inside that js file, i have a Ajax.Updater calling.

Code:
new Ajax.Updater('/subdir/controller/method/args', 'my_div', {});

What I want is put a base_url in '/subdir/', cause probably the subdir of application will change (i don't know what will be the name, so i need to use base_url).

If the js was wrote in the view, it's ok, i could use
Code:
new Ajax.Updater('<?=base_url();?>controller/method.....

But that's not the case :blank:

Helps? Ideas? Lights?

Thanks


Messages In This Thread
Javascript + base_url() - by El Forum - 11-22-2007, 05:27 AM
Javascript + base_url() - by El Forum - 11-22-2007, 06:04 AM
Javascript + base_url() - by El Forum - 11-22-2007, 06:14 AM
Javascript + base_url() - by El Forum - 11-22-2007, 06:31 AM
Javascript + base_url() - by El Forum - 11-22-2007, 08:26 AM
Javascript + base_url() - by El Forum - 11-22-2007, 09:50 AM
Javascript + base_url() - by El Forum - 11-23-2007, 06:48 AM
Javascript + base_url() - by El Forum - 11-23-2007, 07:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB