Can't use the ajax load method to access CI controller? or... |
[eluser]gusst250[/eluser]
I've tried many ways and searched through many forums, but I found no answer to this, rather simple, problem. In javascript (JQuery) I want to do the ajax-requet "load(...)". Code: $(document).ready(function(){ What is the path to a: controller/method to put in my load("path")?` (The js-file is in a sub-directory to application)
[eluser]mah0001[/eluser]
simply pass the path to your controller, something like: Code: $(document).ready(function(){
[eluser]gusst250[/eluser]
no doesn't work i tried load('<?=base_url()?>controller/method'); load('<?=base_url()?>application/controllers/controller/method'); too. (just for knowing that $("#addNewFile").click(...) works I added an alert there, and it popped up on the click, removed it now though)
[eluser]mah0001[/eluser]
Are you sure the controller path is correct? Can you view the controller page by opening it in the browser directly?
[eluser]gusst250[/eluser]
Yes i can view it directly in browser. One important thing to note here is that: it's not the same controller as loaded the actual view file. I want one controller for all file uploading stuff, and not having a hundred of functions in just one controller
[eluser]mah0001[/eluser]
Try this and post the result: Code: url='<?=base_url()?>controller/method');//path to your controller
[eluser]mah0001[/eluser]
Also try and post the result: Code: url='paste the complete url that worked from the browser here';//e.g. http://localhost/website/controller/method |
Welcome Guest, Not a member yet? Register Sign In |