Why does this if/else not work in jquery for me?
<p>I have the following that fires off when a checkbox is changed.</p>

<pre><code>$(document).ready(function() {
    $("#reviewed").change(function(){
        if ($('#reviewed:checked').val() !== null) {
            $.ajax({
                url: "cabinet_reviewed.php?reviewed=yes",
                cache: false,
                success: function(html){
                    $("#reviewDate").replaceWith(html);
                }
            });
         } else {
             $.ajax({
                url: "cabinet_reviewed.php?reviewed=no",
                cache: false,
                success: function(html){
                    $("#reviewDate").replaceWith(html);
                }
            });
        }
});
})
</code></pre>

<p>This only works once.  I'm looking to see when the check box is changed and what the value of it is once changed.</p>

<p>UPDATE:
I've change the code around to the following (based on everyone's comments)</p>

<pre><code>$(document).ready(function() {
    $("#reviewed").click(
        function() { 
            var rURL = 'cabinet_reviewed.php?reviewed=';
                if ($("#reviewed").is(":checked"))
                   rURL = rURL + "yes";
                else
                   rURL = rURL + "no";
                alert (rURL);
        $.ajax({
            url: rURL,
            cache: false,
            success: function(html){
                $("#reviewDate").replaceWith(html);
            }
        });

    });
</code></pre>

<p>})</p>

<p>The file cabinet_reviewed.php simply echos the value of $_GET['reviewed']
With this updated code the alert shows the correct URL but the second click does not run the .ajax.
Do I need to do something so the .ajax is run again?</p>
