Strange problem with jQuery $.load();
<p>I've encountered another problem with jQuery $.load(). I have two buttons, their visibility is mutually exclusive. A PHP conditional statement determines which is shown. All of that is contained in a div element <code>#subDiv</code>. Once either button is pressed, a PHP post file (two slightly different files for the two different buttons) is ran, and it writes a value to a database. Then, upon post success, I use <code>$.load()</code> to refresh <code>#subDiv</code>, which would (in theory) run the conditional again, and determine that the button that was <i>not there last</i> will now be shown.</p>

<p>My problem is the following:</p>

<ul>
<li>When I click on the button when it is in State A, it will post correctly, and refresh the div to show the button in State B.</li>
<li>When I click on the button when it is in State B, it will post correctly, and refresh the div (according to Chrome Dev Tools), but the button remains in State B. Upon actual browser refresh, the button will appear in the correct State.</li>
</ul>

<p>The two States and their respective post files are almost identical except for the minor necessary differences (one adds to a database table, one deletes from a database table). Seeing as the button correctly changes from State A to State B, but not the reverse, I'm not sure where the problem lies. To complicate things, a browser refresh will reveal the button in the correct state. <code>$.load()</code> is being used by myself to simulate a browser refresh of only one div element, for usability purposes and to cut down on loads. Therefore, I can only assume it is an error of the <code>$.load()</code> method.</p>

<p>Here's the jQuery code that controls the button click handling of both State A and State B:</p>

<pre><code>     //State A
     $('#subButton').live('click',function() {
        $.post("php/retailerNameNotif.php", $("#retailerNameNotif").serialize(), function(){
            $('#retailerNameSubDiv').load('coupon.php #retailerNameSubDiv', function(){$( "button, input:submit, input:button, a#jql, input:radio" ).button();});  
        });            
    });

    //State B
    $('#unsubButton').live('click',function() {
        $.post("php/retailerNameNotifUnsub.php", $("#retailerNameNotifUnsub").serialize(), function(){ 
            $('#retailerNameSubDiv').load('coupon.php #retailerNameSubDiv', function(){$( "button, input:submit, input:button, a#jql, input:radio" ).button();});      
        });      
    });
</code></pre>

<p>Any help?</p>

<p><b>Edit:</b>
As a further complication, I've noticed that occasionally, it will work correctly, switching states exactly as I want. However, on the 6th (and consistently the 6th) time, it goes back to the behavior I described here, getting stuck on one of the States.</p>
