Skip to content

Instantly share code, notes, and snippets.

View .html
<!DOCTYPE html>
<meta charset="utf-8">
<title>JS Bin</title>
body {height: 100vh;display: flex;align-items: center;justify-content: center;}
/* Button component - works only in FF correctly ATM */
blaja / .js
Last active Aug 29, 2015
Not worth a look!
View .js
// Navigate to different location using different BOM && DOM API-s. Paralysis of choice :) Are there more ways ?
location = '';
location.href = '';
window.location = '';
document.location = '';
window.location.href = '';
blaja / .js
Created Aug 1, 2015
Fetch some JSON using Fetch API
View .js
const request = new Request('', {
method: 'GET',
requestMode: 'cors',
fetch(request).then(function(response) {
return response.json();
}).then(function(body) {
blaja / .js
Last active Aug 29, 2015
Simple way to exclude webkit prefixed props in Chrome using some ES6 features.
View .js
// Filter out CSS properties without webkit prefixes in Chrome console
// To find "hidden" properties of an object we need to use Object.getOwnPropertyNames.
property => !property.startsWith('webkit')
View .js
(function () {
'use strict';
return this === undefined; // false
'use strict';
View .js
document.getElementById('btn').addEventListener('click', function() {
"use strict";
const evens = Array.from(document.getElementsByClassName('even'));
for(let even of evens) {
You can’t perform that action at this time.