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

[eluser]Haqqi[/eluser]
[quote author="chefnelone" date="1264614088"][quote author="Dyllon" date="1264549311"]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)...
[/quote]

I had already found a solution, but I'll try your idea as well
thanks.[/quote]

Can you provide your solution too??


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