0

I'm looking for more information regarding detection of <link> elements being fully loaded and parsed by modern browsers.

I've done a decent amount of research, but everything I dig up is pretty antiquated.

For instance, I found this SO post, How to determine if CSS has been loaded?. It references a blog posts, found here, which references various bug reports for Webkit, Chromium, and Mozilla. However, all those bugs have since been resolved and marked as fixed. (Ref: here, here, and here)

Looking at MDN's documentation on link, https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Stylesheet_load_events, their documentation implies that using onload is sufficient, but they don't provide any additional comments on what sort of support it has for older browsers.

My question is simple:

If I am only targeting evergreen browsers -- is using the onload event handler sufficient for detecting whether a CSS file has been loaded? If not, please provide documentation on what patches are required for specific browsers/browser versions.

Community
  • 1
  • 1
Sean Anderson
  • 27,963
  • 30
  • 126
  • 237
  • check these links - http://www.phpied.com/when-is-a-stylesheet-really-loaded/ http://www.zachleat.com/web/load-css-dynamically/ – ANSHUL GERA Feb 17 '16 at 20:04
  • @ANSHULGERA Please read my post. I reference your first link in my post and explain that I already went through it, but found its information old. – Sean Anderson Feb 17 '16 at 20:05

1 Answers1

-2

Use a (temporary) garish background colour in your CSS. If it is loaded it will be instantly obvious. It can later be commented out exactly the same as in C/C++, TEST

background-color: lime;

DEPLOYMENT

/*
background-color: lime;
 */
background-color: pale-blue;
Arif Burhan
  • 507
  • 4
  • 12