开发者

Codeigniter and Jquery .load() behaving stangely

开发者 https://www.devze.com 2023-02-28 11:02 出处:网络
So I\'m using .load() to call a CI method to load some code into a div like normal. CI loads the correct content into the div UNLESS there is a tr开发者_运维技巧ailing slash on the class, then it actu

So I'm using .load() to call a CI method to load some code into a div like normal. CI loads the correct content into the div UNLESS there is a tr开发者_运维技巧ailing slash on the class, then it actually ignores the method I am loading and loads the default method in that class ... ie:

THIS WORKS FINE:

I call .load('http://domain.com/class/ajaxmethod')from domain.com/class/method

THIS DOES NOT:

I call .load('http://domain.com/class/ajaxmethod')from domain.com/class/method/

It will actually load http://domain.com/class/ and ignore the method

Is there something obviously wrong here??


Codeigniter automatically structures urls like this:

http://domain.com/index.php/class/functions/params

The way you've written the urls in your post (http://domain.com/class/functions/params) implies that you are performing some htaccess rewrite on the url. This is most likely not accounting for the trailing slash and therefore doing something unexpected.

If this is not the case and you've just mistyped your url, can you confirm whether or not the url is correct when visited with a browser and has a trailing slash?

0

精彩评论

暂无评论...
验证码 换一张
取 消