简体   繁体   中英

Codeigniter Controller name doesn't work with ajax

I have a small Codeigniter application. I have one controller named "Vendor" which works perfectly, AJAX calls and all. However, my second controller name "Ad" doesn't seem to work with jQuery AJAX. Everytime an AJAX call is made, the error handler is called. Error output is:

statusText

"[Exception... "<no message>"  nsresult: "0x805e0006 (<unknown>)"  location: "JS frame :: http://localhost/sbkch/backend/backend/assets/js/plugins/pace/pace.min.js :: b/a/a.open :: line 2"  data: no]"

However, as soon as I change the name of the controller to "Adthisisalongname", things start working as expected. I tried playing around and renamed my controller to "Adverts". AJAX stopped working. Other methods are working fine (index, etc). I then changed the name to Advendor and AJAX started working again. What seems to be the problem? Are "Adverts" and "Ad" reserved keywords in Codeigniter? I couldn't find any documentation pertaining to the same. Please note that when the AJAX calls don't work, it doesn't even show up in Firebug as request being made to the server in the "Console" tab. Also, I am not using form_open() function.

客户端浏览器出现此问题是因为它们阻止副词使用ajax并劫持用户数据,并且与CodeigniterjQuery AJAX无关

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM