The jQuery function to add a click handler to a button and open a modal window should work. See the example below. I can only suggest you take a look, for example, on Chrome DevTools to see if there are any JavaScript errors in your console.
$(document).ready(function(){
$('#btn').click(function(){
$('#server_msg_modal').modal('show');
});
});
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" />
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<div class="btn btn-danger" href="#server_msg_modal" data-toggle="modal">using data attribute</div>
<div class="btn btn-danger" id="btn">using jQuery click handler</div>
<div class="modal fade" id="server_msg_modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>Modal body</p>
</div>
</div>
</div>
</div>
Run codeHide result source
share