URIs from Ajax |
Brand new to CodeIgniter and looking forward to converting my existing website to it. I've been through the "first application" section of the user guide and have a good handle on the general architecture.
My current application has a lot of jquery code, mostly to handle the submission of forms for adding/editing database data. Currently the urls in my Ajax calls are relative, for example "pleasedothis.php". I have separate environments for dev, test, and live so doing it this way always resolves to the correct base url based on where the server is running. My question is, will the same technique work with CI? For example, if I send the Ajax request to "pleasedothis/list" with no base url, will CI recognize it and route it correctly. Thanks, Pete
No it wont.
You need to tell it were to go controller/method Code: // like this SEE: CodeIgniter 4 Ajax Form Submit Validation Example What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
OK Thanks. Sounds like the same as using window.location.origin in javascript and including that in the URI
|
Welcome Guest, Not a member yet? Register Sign In |