UNPKG

fg-loadcss

Version:

A function for loading CSS asynchronously

20 lines (18 loc) 672 B
<!doctype HTML> <html> <head> <title>Blocking Test</title> <meta charset="utf-8"> <script> <!--#include virtual="../src/loadCSS.js" --> <!--#include virtual="../src/onloadCSS.js" --> var ss = loadCSS( "slow.css" ); onloadCSS( ss, function() { document.body.innerHTML += '<h1>onload!!!</h1>'; }); </script> </head> <body> <p>This is a test to see whether or not a loadCSS call will block render. This page uses loadCss to load a CSS file that has a 5 second delay built into its server response time. If loadCSS works properly, you should be able to read this text before the page is styled as white text on green background.</p> </body> </html>