Skip to content

aFarkas/link-preload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

link-preload

It's a polyfill for <link rel="preload">, great feature implemented only in WebKit so far (see lastest data here). 100% compatibility with specification and existing implementations is not guaranteed.

Why?

Just read great article here.

Example usage

Check out live demo.

<head>
   <link
      rel="preload"
      as="style"
      href="/link/to/stylesheet.css"
      onload="this.onload=function(){};this.rel='stylesheet';"
    >
</head>
<body>
  <script src="/link/to/polyfill.js"></script>
</body>

Important note: value of onload attribute is very important. Resetting it to no-op function is crucial for working the polyfill cross-browser (it's required by Internet Explorer which tends to falling into endless loop otherwise).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published