title: How to update data attribute on Ajax complete
body: <p>I'm using October CMS and in the framework I can make an AJAX call using the following HTML element:</p>
  
  <pre><code>&lt;a href="#" class="sbutton" data-request="onSavedeal" 
       data-request-data="deal_ID:'14779255',type:'local',active:'0'"&gt;
      &lt;i class="material-icons pink-text listfavorite"&gt;favorite&lt;/i&gt;                      
  &lt;/a&gt;
  </code></pre>
  
  <p>Whenever this link is clicked on a favorite button fires off an update to a controller "onSavedeal". Updating the database works fine on the first click. However, after updating, the value for the "data-request-data" attribute isn't updated so the button does not work for subsequent clicks.</p>
  
  <p>I need to make the link change so that "active:'0'" becomes "active:'1'". The resulting full element would be</p>
  
  <pre><code>&lt;a href="#" class="sbutton" data-request="onSavedeal" 
       data-request-data="deal_ID:'14779255',type:'local',active:'1'"&gt;
      &lt;i class="material-icons pink-text listfavorite"&gt;favorite&lt;/i&gt;                      
  &lt;/a&gt;
  </code></pre>
  
  <p>In the framework I can add another attribute called "data-request-success" which executes a javascript function (or code) up successful completion of the AJAX call. How can I make a function called "updateactive()" which would toggle the active value between 0 and 1. The final element should look like:</p>
  
  <pre><code>&lt;a href="#" class="sbutton" data-request="onSavedeal" 
       data-request-data="deal_ID:'14779255',type:'local',active:'0'"
       data-reuqest-success="updateactive();"&gt;
      &lt;i class="material-icons pink-text listfavorite"&gt;favorite&lt;/i&gt;                      
  &lt;/a&gt;
  </code></pre>