Попробуйте: -
$("button").on('click', function(){
$.ajax({
url: $('input[name=url]').val(),
type: 'HEAD',
success: function(data, textStatus, request){
$("#output").text(request.getResponseHeader('Last-Modified'));
},
error: function (request, textStatus, errorThrown) {
$("#output").text(request.getResponseHeader('Last-Modified'));
}
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" name="url" placeholder="URL">
<button type="button">Check</button>
<br/><br/>
<div id="output"></div>