This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.box | |
{ | |
position: sticky; | |
bottom: 20px; | |
width: 600px; | |
margin: auto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bug: | |
Feature: | |
Improvement: | |
Change: | |
Other: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fruits = [ 'apple', 'orange', 'mango' ]; | |
// for / of loop | |
for ( e of fruits ) | |
{ | |
// e is now an element of the array | |
console.log( e ); // Output: apple, orange, mango | |
} | |
// for / in loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static | |
absolute | |
fixed | |
relative | |
sticky |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reload current page | |
location.reload(); | |
// Ref: https://developer.mozilla.org/en-US/docs/Web/API/Location/reload | |
// Reload page at an interval | |
setTimeout( function(){ location.reload(); }, 30 * 1000 ); // Reload at every 30 seconds | |
// Alternative | |
setTimeout( () => { location.reload(); }, 30 * 1000 ); // Reload at every 30 seconds | |
// Ref: https://developer.mozilla.org/en-US/docs/Web/API/setTimeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// One time event | |
setTimeout( function(){}, 1000 ); | |
// Repetitive event | |
setInterval( function(){}, 1000 ); | |
// If these need to be canceled, then assign them | |
// to a variable and then clear them like this. | |
clearTimeout( assignedVar ); | |
clearInterval( assignedVar ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s = document.createElement( 'style' ); | |
s.innerText = ` | |
.box | |
{ | |
display: none; | |
} | |
`; | |
document.head.appendChild( s ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function qs( cls ) | |
{ | |
return document.querySelector( cls ); | |
} | |
function qsa( cls ) | |
{ | |
return document.querySelectorAll( cls ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="shortcut icon" href="src/favicon.ico"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header( 'Access-Control-Allow-Origin: *' ); | |
print_r( $_POST ); |