Load file once with jQuery ajax load method

Loading a file onclick only once, for the first click, on the next clicks the content of the div into which the file is loaded won't be empty so the file won't be loaded twice.

<div id="myContent"></div>
<a href="javascript:void(0);" id="myLink">Click to load file</a>

<script type="text/javascript">
$('a#myLink').click(function() {
    if($('#myContent').html() == '') {
        $('#myContent').load('path-to-file.html');
    }
});
</script>