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 9149913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:32:32+00:00 2026-06-17T11:32:32+00:00

I have a site that loads CSS and fonts from Google Web Fonts .

  • 0

I have a site that loads CSS and fonts from Google Web Fonts. However, one place where the site will be used is a local intranet with no Internet access.

I still want to use the fonts from Google where I can for the benefits that Google offers, such as the fonts being downloaded from a CDN and possibly already being cached on the user’s computer from visits to another site that uses them.

I also use Google-hosted jQuery and I use the following code (from HTML5 Boilerplate) to load jQuery from my server if Google is not accessible:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.0.min.js"><\/script>')</script>

I am looking for a way to do the same for CSS files.

I have used <img src="..." onerror="..." /> in the past for handling images that don’t load, so I was wondering if I can use that for stylesheets that don’t load too. I did a quick test in a few browsers, using <link href="..." onerror="..." rel="stylesheet" type="text/css" />, and the onerror was executed in all of them, but I would like to find out if I can expect this to work consistently in all browsers. Or is there a better way to do it?

I saw several other answers here that discuss watching the document.styleSheets collection, but that sounds like much more of a hack than this does.


Note: This is really more of a “is this practical and do people use it”-question than a “what does the spec have to say about it”-question.

  • 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-06-17T11:32:32+00:00Added an answer on June 17, 2026 at 11:32 am

    I believe the list of supported events on <script> and <link> at pieisgood is what you’re looking for.

    As you can see, onload is the most widely supported for <link> which is very lacking in working events. But you could try to implement an error event by having onload clearTimeout for some function that assumes an error happened.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this GWT application that I placed within NodeJS/Express. The site loads, however,
I have an intranet site that loads in IE7 compatibility mode, unless the user
I have a site that uses a large centered background image, which naturally loads
I have some jQuery that loads a new stylesheet like so... $('head').append('<link rel=stylesheet type=text/css
Have a client with a kiosk app that loads a major hotel's site in
I have a wordpress site that intermittently displays incorrectly due to a bad css
I have a site I'm building in PHP, and have a page that loads
I have an html site that doesn't have page changes. It just loads different
I have a script on jquery that load some site in iframe using: $(#demo_frame).attr('src',
I have a site that i want to redirect all requests accept for 1

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.