As we have seen in our previous Ajax requests we can grab data from different sources to output the the page. But what happens if the client has logged timmed out ? Trying to send the client to a login page can be a little more tricky than it sounds.
In this screencast I will show you a quick way to listen for unauthorized access and send the client to a login page.
Hopefully this will be a fun screencast for you. We will be using Jquery $.ajax GET request combined with the Codeigniter Pagination Library.
Im sure you will be suprised how easy this is achieved.
Hopefully by now you will have had a better understanding on how to use Jquery with Coedigniter. We have looked at the $.post & $.get request so far and have passed some simple data between them.
In this the last part of this series we will take a look at the $.ajax request. The $.ajax request is very powerfull and far to much to talk about in this one screencast so I would strongly suggest you take a look at the JQuery Documentation
So now we have looked at the $.get request we now are going to look at the $.post request.
In this screencast we can see how we can submit form data through this request.
Following on from part one in this screencast we will take a look at one of the Ajax functions $.get.
We will take a look at how to perfom a $.get request and how to handle the callback.
I thought before I do my next screencast with pagination I would do an introduction with Jquery Ajax.
There are a number of excellent Javascript Frameworks (Prototype, Mootools, Dojo, Scriptaculous etc..) but my personal flavour is Jquey. Like Codeigniter it has a great user guide which is easy to follow and a great network of users. And one of the great tools it has in its API is AJAX (Asynchronous JavaScript and XML).