Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7194693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:25:28+00:00 2026-05-28T20:25:28+00:00

I have an initialise function in my app that I want to trigger when

  • 0

I have an initialise function in my app that I want to trigger when two conditions have been met: 1) the window has loaded: $(window).load() and 2) Typekit has loaded.

$(window).load(function() {
    try {
        Typekit.load({ active: initialise });
    } catch (e) {}
});

At the moment, this code is waiting until the window has loaded (including all resources e.g. images) before it starts to load the Typekit web fonts, and then, when they have loaded too, it will initialise.

However, I want Typekit to load before the window has loaded. They should load asynchronously. So:

$(window).load(initialise);

try {
    Typekit.load({ active: initialise });
} catch (e) {}

Now the Web fonts are loading asynchronously, but the problem is, I need the initialise function to trigger only when both 1) the window has loaded: $(window).load() and 2) Typekit has loaded. Sometimes, the window will load before Typekit has loaded, and sometimes it is the other way round.

So my question is: how can I trigger initialise as soon as both of my criteria have been fulfilled?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:25:28+00:00Added an answer on May 28, 2026 at 8:25 pm

    I found a solution that uses jQuery’s $.holdReady:

    $.holdReady(true);
    
    Typekit.load({
        active: function () {
            $.holdReady(false);
        }
    });
    
    $window.load(function () {
        $document.ready(initialize);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using javascript and jQuery. I have a problem that my web app has
I have an ASP.NET MVC web app and have a function that I need
I have a class which has functionality to initialise opengl and run it in
I'm writing a simple App Engine app. I have a simple page that allows
I have Angle class that I want initialized to a random value. The Angle
I have a view that creates and populates a Selectlist. I want to bind
In my Rails app I have a helper method location that gets the coordinates
I have a web app that displays a web page in a web view.
I have an app that loads several resources when it's first run, which are
I have the following code for my google maps app. What I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.