jQuery.post() and modifying the HTML code of a div asap : I have a very simple line of HTML code:

    <div id="bio">Something...</div>

And then I have some jQuery code. It should be very fast. This is important. I do not want to kill the browser.

So, the problem is that I do not which code is the best one, A) or B).

I also would like to know are they both 100% cross-browser solutions or not if jQuery/JavaScript is enabled on the browser.

Or should I forget both of them and do something else instead?

A)

    $(document).ready(function() {
      get_bio_data = function() {
        var bio = 106;
    
        jQuery.post("get_bio.php", {
          bio: bio
        }).done(function(data) {
          $('#bio').html(data);
    
          setTimeout(get_bio_data, 5000);
        });
      };

      setTimeout(get_bio_data, 5000);
    });

B)

    $(document).ready(function() {
      function get_bio_data() {
        var
          bio = 106,
          old_bio = document.getElementById('bio');
    
        jQuery.post("get_bio.php", {
          bio: bio
        }).done(function(data) {
          var new_bio = document.createElement('div');
          new_bio.innerHTML = data;
          new_bio.id = 'bio';
    
          old_bio.parentNode.replaceChild(new_bio, old_bio);
          old_bio = new_bio;
    
          setTimeout(get_bio_data, 5000);
        });
      };
    
      get_bio_data();
    });