Welcome Guest, Not a member yet? Register   Sign In
How to point to a controlle from a js file?
#2

[eluser]Dyllon[/eluser]
I like to define my base URI, module/controller, and method in my view header so I can use them in any javascripts.

Code:
var BASE_URI        = "<?php echo base_url(); ?>";
var CI_CONTROLLER   = "<?php echo $controller; ?>";
var CI_METHOD       = "<?php echo $method; ?>";

Then use the variables in your javascript

Code:
$.post(BASE_URI + CI_CONTROLLER + '/' + CI_METHOD, order, function(theResponse)...


Messages In This Thread
How to point to a controlle from a js file? - by El Forum - 01-26-2010, 04:37 AM
How to point to a controlle from a js file? - by El Forum - 01-26-2010, 11:41 AM
How to point to a controlle from a js file? - by El Forum - 01-27-2010, 05:41 AM
How to point to a controlle from a js file? - by El Forum - 02-15-2010, 09:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB