catch - 2

RxJS 5 catch

HTML

<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.8/dist/global/Rx.umd.js"></script>
<div id="content-01" style="float: left; width: 150px; height: 150px; border: 2px solid red;">
  
  
</div>

JavaScript

// Shorthand for $( document ).ready()
$(function() {
    appendDIV("content-01", "some text");
    
    $('#content-01  > p').each(function( index ) {
  console.log( index + ": " + $( this ).text() );
});
});

  function appendDIV(idDIV, txt) {
    $("#" + idDIV).append('<p>' + txt + '</p>');
  }