$(function(){ var includes = $('[data-include]'); jQuery.each(includes, function(){ var file = '/' + $(this).data('include') + '.html'; $(this).load(file); }); }); // $(document).ready(function(){ // $( "#header" ).load( "/menu.html" ); // });