[eluser]littlejim84[/eluser]
Hello there. I'm currently in the middle of making a web app, and it's going pretty well. I've been dipping in and out of CI for a while now, but concentrating on this app has really made CI shine for me. It's absolutely quality!
I'm using jQuery for all the UI stuff and want to use AJAX (for simplicity) with it too. I don't need anything crazy, just basic AJAX stuff.
At the moment, my app lists different things in different views. So, for example, the latest members to the app. This is a list in the members view that is generated. With this, there is options for each row of the data. Options to mark the item as 'read' and bookmark the item for reading later (for example). The buttons are always there, to the right of the row data, either greyed out (if the option hasn't been clicked) or coloured if it has. At the moment, when I click to bookmark John (for example), it goes to a controller called 'bookmark' and passed 'member' and then the id. So the url looks like this : localhost/bookmark/member/32. It runs that and then redirects back the page list I was on. This works great enough...
But I wonder... Is there anyway using jQuery's AJAX to call that controller link and it pass back the value (either 'true' or 'false' for the bookmark item for example). ?? ... If it can be the case where a user clicks on the bookmark button, it'll AJAX that out to the controller, do the action, and then pass back 'true'. Which I will then update the button with the true state using further jQuery?
I'd love to know what commands and techniques would be needed to get this going. Cheers!!!