Another pattern 

$('#myModal').modal({
    remote: '/topic/notes' + topic.id,
    show: false,
    keyboard: true
})

$('#myModal').modal('show');

$('#myModal').modal('hide');