When building responsive websites you often want to run a script when the page loads. But when you resize the window the layout breaks. You can use the on method to run your code if the page loads or has been resized.
// run on page load and when the window is resized $(window).on("load resize",function(e){ console.log("adjust layout"); $('.page-header').matchHeight(".target"); });