<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<!-- Including other optional polyfills depending on expected browser support scope -->
<script
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver"
crossorigin="anonymous"
></script>
<script async src="https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@0.2.0/loading-attribute-polyfill.min.js" integrity="sha256-kX73NqVUoUbV0K44kgoqP8P8IZfU0OEjr/afCnK2Mrg=" crossorigin="anonymous"></script>
</head>
<body>
<p>The sample images embedded into this document are including textual information on their embedding technique, like the HTML tag, attributes and pixel density to show you that the correct image has been loaded.</p>
<header>
<!-- Regular images with loading="lazy" attribute provided for testing -->
<noscript class="loading-lazy">
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-src-loadinglazy.250x150.png"
loading="lazy"
alt=".."
width="250"
height="150"
/>
</noscript>
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-src-loadingeager.250x150.png"
loading="eager"
alt=".."
width="250"
height="150"
/>
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-src-loadingauto.250x150.png"
loading="auto"
alt=".."
width="250"
height="150"
/>
<picture>
<noscript class="loading-lazy">
<source
media="(min-width: 40em)"
srcset="
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/picture-media1x-loadinglazy.250x150.png 1x,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/picture-media2x-loadinglazy.500x300.png 2x
"
/>
<source
srcset="
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/picture-1x-loadinglazy.250x150.png 1x,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/picture-2x-loadinglazy.500x300.png 2x
"
/>
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/picture-imgsrc-loadinglazy.250x150.png"
loading="lazy"
alt=".."
width="250"
height="150"
/>
</noscript>
</picture>
<noscript class="loading-lazy">
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-src-loadinglazy.250x150.png"
srcset="
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-srcset1024w-loadinglazy.1024x400.png 1024w,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-srcset640w-loadinglazy.640x400.png 640w,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-srcset320w-loadinglazy.320x320.png 320w
"
sizes="(min-width: 36em) 33.3vw, 100vw"
alt="A rad wolf"
loading="lazy"
/>
</noscript>
<!-- Regular iframe with loading="lazy" attribute provided for testing -->
<noscript class="loading-lazy">
<iframe
src="https://player.vimeo.com/video/87110435"
width="320"
height="180"
loading="lazy"
></iframe>
</noscript>
</header>
<main>
<!-- Lazy-load an offscreen image when the user scrolls near it -->
<noscript class="loading-lazy">
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazyimg-src-loadinglazy.250x150.png"
loading="lazy"
alt=".."
width="250"
height="150"
/>
</noscript>
<!-- Load an image right away instead of lazy-loading -->
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-src-loadingeager.250x150.png"
loading="eager"
alt=".."
width="250"
height="150"
/>
<!-- Browser decides whether or not to lazy-load the image -->
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/img-src-loadingauto.250x150.png"
loading="auto"
alt=".."
width="250"
height="150"
/>
<!-- Lazy-load images in <picture> -->
<picture>
<noscript class="loading-lazy">
<source
media="(min-width: 40em)"
srcset="
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazypicture-media1x-loadinglazy.250x150.png 1x,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazypicture-media2x-loadinglazy.500x300.png 2x
"
/>
<source
srcset="
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazypicture-1x-loadinglazy.250x150.png 1x,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazypicture-2x-loadinglazy.500x300.png 2x
"
/>
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazypicture-imgsrc-loadinglazy.250x150.png"
loading="lazy"
alt=".."
width="250"
height="150"
/>
</noscript>
</picture>
<!-- Lazy-load an image that has srcset specified -->
<noscript class="loading-lazy">
<img
src="https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazyimg-src-loadinglazy.250x150.png"
srcset="
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazyimg-srcset1024w-loadinglazy.1024x400.png 1024w,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazyimg-srcset640w-loadinglazy.640x400.png 640w,
https://mfranzke.github.io/loading-attribute-polyfill/demo/img/lazyimg-srcset320w-loadinglazy.320x320.png 320w
"
sizes="(min-width: 36em) 33.3vw, 100vw"
alt="A rad wolf"
loading="lazy"
/>
</noscript>
<!-- Lazy-load an offscreen iframe when the user scrolls near it -->
<noscript class="loading-lazy">
<iframe
src="https://player.vimeo.com/video/20997150"
width="320"
height="180"
loading="lazy"
></iframe>
</noscript>
</main>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |