jQuery not properly executing an ajax request
<p>I've got another similar script running just fine, i don't see why this isn't working.  Is there anything wrong with this code?                        </p>

<pre><code>$("#lastname").keyup(function(event){
    var keyCode = event.keyCode || event.which;
    if(keyCode === 13) {
        passOnRegFront();
    }
    });
    $("#register").click(function() {
        passOnRegFront();
    });
function passOnRegFront() {
        var firstname = $("#firstname").val();
        var lastname = $("#lastname").val();
        var dataString = '&amp;firstname=' + firstname + '&amp;lastname=' + lastname;
        if(email=='' ||  password=='') {
            $('#success').fadeOut(400).hide();
            $('#error').fadeOut(400).show();
        } else {
            $.ajax({
                type: "POST",
                dataType: "JSON",
                url: "&lt;?=base_url()?&gt;index.php/home/passOnReg",
                data: dataString,
                json: {session_state: true},
                success: function(data) {
                if(data.registered == true) { // true means user is logged in.
                    $("#main1").hide();
                    $("#main1").load('&lt;?=base_url()?&gt;index.php/home/dashboard');
                }
            }
        });
        }
    }
});
</code></pre>
