Welcome Guest, Not a member yet? Register   Sign In
Has Anyone Got Some Simple AJAX Tutorial Resources?
#2

[eluser]Pascal Kriete[/eluser]
For a start there's http://video.derekallard.com/. Then you might want to check out some of sample applications - quite a few of those have ajax functionality.

In my personal opinion however, you shouldn't learn ajax on codeigniter, it just adds another layer of complexity. The way I learned was just a simple one page script such as this:
Code:
<?php

// This is our 'backend'
if(isset($_POST['ajax'])) {
    echo 'ajax works :D';
    exit;
}

?>
<html>
    <head>
        <title>Ajax Test</title>
        <script src="/prototype.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" charset="utf-8">
        <!--
            
            init = function() {
                $('callthatsucker').observe('click', ajaxify);
            }
            
            ajaxify = function(event) {
                event.stop();
                var url = '';    //Self submit
                new Ajax.Request(url, {
                    method: 'post',
                    parameters: {ajax: 'true'},
                    onSuccess: function(transport) {
                        $('content').update(transport.responseText);
                    }
                });
            }
            
            document.observe('dom:loaded', init);
        //-->
        </script>
    </head>
    <body>
        <div id='content'>Ajax not called yet :(</div>
        <a href='www.google.com' id='callthatsucker'>Ajaxify me</a>
        <div>If that link goes to google, something went wrong</div>
    &lt;/body&gt;
&lt;/html&gt;
Basically all your ajax calls self submit, that way you have your backend right there and don't go switching files looking for stupid little bugs. In fact, I still develop my javascript this way and plug it into the application when I know it works.

Make sure to get a decent grounding in javascript and it's screwed up syntax before attempting ajax stuff, it'll make your life easier in the long run.


Messages In This Thread
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 02-24-2008, 08:22 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 02-24-2008, 08:55 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 02-24-2008, 09:06 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 02-24-2008, 09:10 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 02-24-2008, 09:14 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 03-03-2008, 09:12 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 04-23-2008, 01:31 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 04-23-2008, 06:06 AM
Has Anyone Got Some Simple AJAX Tutorial Resources? - by El Forum - 04-23-2008, 08:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB