Explain Codes LogoExplain Codes Logo

Javascript

Is it bad practice to embed JavaScript into the body of HTML?

javascript
unobtrusive-javascript
performance
browser-compatibility

Is autocomplete="off" compatible with all modern browsers?

javascript
autocomplete-behavior
browser-testing
form-security

Invalid shorthand property initializer

javascript
prompt-engineering
linting-tools
debugging

Intercept a form submit in JavaScript and prevent normal submission

javascript
event-handling
form-validation
security

In querySelector: how to get the first and get the last elements? What traversal order is used in the dom?

javascript
dom-traversal
javascript-queries
node-list

In JavaScript, why is "0" equal to false, but when tested by 'if' it is not false by itself?

javascript
type-coercion
equality-checks
truthiness

In JavaScript, how to conditionally add a member to an object?

javascript
conditional-properties
object-creation
javascript-syntax

Http Authorization Header in EventSource (Server Sent Events)

javascript
event-source
sse
polyfills

How to write a countdown timer in JavaScript?

javascript
countdown-timer
javascript-class
event-loop

How to validate inputs dynamically created using ng-repeat, ng-show (angular)

javascript
angular-validation
dynamic-forms
ng-repeat

How to use JavaScript regex over multiple lines?

javascript
regex
performance
best-practices

How to use if statements in underscore.js templates?

javascript
template-engineering
conditional-statements
javascript-templates

How to use a variable for a key in a JavaScript object literal?

javascript
prompt-engineering
functions
callbacks

How to turn a String into a JavaScript function call?

javascript
functions
callbacks
promises

How to trim a string to N chars in Javascript?

javascript
prompt-engineering
functions
callbacks

How to trigger jQuery change event in code

javascript
event-handling
jquery
javascript-best-practices

How to trigger a file download when clicking an HTML button or JavaScript

javascript
download-triggers
blob-urls
data-urls

How to split a comma separated string using JavaScript?

javascript
prompt-engineering
functions
callbacks

How to show popup message like in Stack Overflow

javascript
popup-engineering
javascript-libraries
accessibility

How to set time delay in javascript

javascript
async-await
setTimeout
event-loop