Search code examples
jqueryajaxloaddocument-ready

How to load a google font on DOM ready?


I want to load this font <link href="https://fonts.googleapis.com/css?family=KoHo:400" rel="stylesheet"> with Ajax, on DOM ready, is this possible?


Solution

  • I'm not exactly sure what you are trying to achieve here. If it is a page speed issue and you want to load the fonts asynchronously, see this article:
    https://www.lockedownseo.com/load-google-fonts-asynchronously-for-page-speed/

    Loading in Google Fonts via the <link> tag will ensure the fonts are rendered before the page is loaded.