title: Triggering an Ajax POST on the onblur() event
body: <p>I have an Ajax problem.</p>
  <p>There is an input field and I want to submit the changed value on the <code>onblur()</code> event. It all works fine except that there is an irritating flicker.</p>
  <p>I type in the new value and click away. The old value then flashes back before the value changes to the new value...</p>
  <p>This is how I am doing it. I attach an <code>onblur</code> function to the input element:</p>
  <pre><code>  onblurevent = function()
    {
      HN.Gui.HTML.post(bindingpage, bindingref, this.value);
    };
    HN.Util.addEvent(elem, &quot;blur&quot;, onblurevent);
  </code></pre>
  <p>The event is bound with a util function:</p>
  <pre><code>HN.Util.addEvent = function(obj, type, fn)
  {
    if ( obj.attachEvent ) {
      obj['e'+type+fn] = fn;
      obj[type+fn] = function(){obj['e'+type+fn]( window.event );};
      obj.attachEvent( 'on'+type, obj[type+fn] );
    } else
      obj.addEventListener( type, fn, false );
  };
  </code></pre>
  <p>And it triggers a jQuery post when it fires:</p>
  <pre><code>HN.Gui.HTML.post = function(page, ref, value)
  {
      var json = (value == &quot;&quot;)
      ? {clear: &quot;contents&quot;}
      : {set: {formula: value}};
  
    var url = page + ref + &quot;?attr&quot;;
  
    $.post(url, JSON.stringify(json));
  };
  </code></pre>
  <p>It is all pretty straight forward.</p>