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

[eluser]0plus1[/eluser]
I have the need to mantain a project in two direction, a sandbox copy and a live version. The live version has a different directory structure so in javascript I need to change all the ajax calls:

Quote:/sandbox/controller/method

to

Quote:/controller/method

all this useless work could be simplified by using:

Quote:<?=base_url();?>controller/method

Problem is that the js is in a javascript file.

Is there a reccomended way to use base_url with javascript? I understand I could use: javascript.php problem is that with codeigniter I have to create a controller then a view.

Are there workaround / elegant way to achieve this?

Thank you


Messages In This Thread
base_url() and javascript - by El Forum - 10-28-2009, 04:45 AM
base_url() and javascript - by El Forum - 10-28-2009, 05:08 AM
base_url() and javascript - by El Forum - 10-28-2009, 05:08 AM
base_url() and javascript - by El Forum - 10-28-2009, 07:25 AM
base_url() and javascript - by El Forum - 10-28-2009, 10:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB