Xah Web Dev Blog

Meaning of Font Size and Em Height

The State Of JavaScript, 2016

The State Of JavaScript By Sacha Greif. @ http://stateofjs.com/2016/introduction/

A survey, of js compilers, langs, frameworks, etc.

there's a new js framework, vue.js. New js framework just keeps popping up. Amazing.

JavaScript quiz: will this work x[f](a)[g](b)

don't just guess. try it.

HTML: Allowed Characters in id Attribute (updated)

in HTML5 the id attribute string can be any char except space. e.g. it can start by digit, or #, or ♥

HTML XML Entities (old page, new url)

Xah JavaScript tutorial, 2016-07 update

New version is out.

Buy Xah JavaScript Tutorial

Lots things has been updated. Several page have been re-written from scratch.

Most of the DOM scripting tutorial are re-written. And am working on more complete tutorial of DOM scripting.

Also working on ES6 features.

If you bought it already, you'll receive update.

if you don't have it it, give it a shot! Thanks.

The Sad State of Web Development

You see the Node.js philosophy is to take the worst fucking language ever designed and put it on the server.

The Sad State of Web Development By Drew Hamlett. @ https://medium.com/@wob/the-sad-state-of-web-development-1603a861d29f

history of CSS: The Languages Which Almost Became CSS

The Languages Which Almost Became CSS By Zack Bloom. @ https://eager.io/blog/the-languages-which-almost-were-css/

User Interface design: navigation panel, with scrollbar or no?

which you prefer?

side panel UI static-s side panel UI scrollbar-s
Fisrst picture: static panel, scroll with page. Second picture: with its own scrollbar.

vote on twitter at https://twitter.com/xah_lee/status/747375376616165376

or vote on Google Plus at https://plus.google.com/+XahLee/posts/MebjN6pPy5T


JavaScript Execution Order (rewrote. improved clarity)

JavaScript: Intro to Event-Based Programing (rewrote)

Reddit greed level up'd.

reddit screen block 2016-06-22
now, reading reddit without login will popup prompt and block view.
JavaScript quiz variable in array 2015-08-09
JavaScript Quiz: Variable in Array

(repost. on its own page)

html frameset 2016-06-21
HTML: Split Windows; Frameset

HTML Frameset is actually really a good UI. Unfortunately, it's killed by geeks for geek reasons.

Today, there's still not a workaround.

see it here: HTML: Split Windows; Frameset

the Java doc is still in html frameset, and it won't be going away anytime soon. Java Platform SE 8

(wow, so this means, browser will actually not deprecate it!)

JavaScript: Semicolon Rules (major rewrite, again. Now, explaining the new school of omitting semicolon)

actually, i now tend to think omitting semicolon is better. The rule is just far more simpler. It is also great saver on typing. Also, the semicolon in js is really a pain, because when editing code, refactoring, change between statement and expression, you have to constantly add / remove semicolon. But if you omit them at all times now, you don't have this problem anymore.

Web Design: Relative Date Sucks

the fashionable web design date “posted 834 days ago” is fscking annoying.

it began several years ago… around 2008 maybe.

say no to it.

i think, it'll eventually change back, to real dates.

〔➤see Web Design

2 nice JavaScript lib for plotting math functions

function-plot. runs on top of d3js. features interval arithmetics. https://github.com/maurizzzio/function-plot/

jsxgraph. geometer sketchpad like lib. http://jsxgraph.uni-bayreuth.de/wp/index.htmlhttps://github.com/jsxgraph/jsxgraph

JavaScript: Semicolon Rules. Much update.

there are 2 schools of thought. One, the Douglas Crockford classicist, recommend adding semicolon. The other, often younger, JavaScript coding hotshots in industry, recommend ommiting semicolon at all times.

JavaScript SVG set style problem

3 hours spent debugging this

svgElement.setAttribute("style", styleStr)


svgElement.style = styleStr;

The latter does not work on a 2011 old android tablet running 3 years old CyanogenMod running Google Chrome (too lazy to check version).

JavaScript Quiz. Array Splice Insert Without Nesting

// js quiz

// you have
function add () { return ["a","b"]; }
var tt = [1,2,3,4];

// you want
// [ 1, 'a', 'b', 2, 3, 4 ]

// modify tt, using splice. How?

for answer, see JavaScript: Array Splice Example

JavaScript: Array.prototype.reduce and reduceRight Example (new page. Basic example.)

JavaScript: Compute Date Range

Understand Atomic CSS in 1 Minute

JavaScript: Flatten Nested Array

see also JavaScript: Array How-To

JavaScript: Array.prototype.every Example

JavaScript: Test Equality of Objects

now, a function that compare 2 arbitrary objects, by deep dive.

JavaScript: Array Compare Equality (updated)

JavaScript: DOM Whitespace Nodes (added more example)

never, use delete to remove element in a array. Use Array.prototype.splice. It is the most general way to insert or remove slices at any position.

See JavaScript: Array Splice Example

JavaScript: Method Chaining and Function Composition

new version of JavaScript in Depth is out. Sent to previous buyers.

Buy Xah JavaScript Tutorial

if you bought it before, please leave a comment or review at Buy Xah JavaScript Tutorial. Hopefully positive. Thanks.

JavaScript: Replace All Children, createDocumentFragment

JavaScript: Randomize DOM List or Element Children

web bugs is now called web beacon.

that is, those 1 by 1 pixel image file used for tracking. (and many other techniques, now being standardized if not already)

Beacon spec https://www.w3.org/TR/beacon/

json syntax vs JavaScript syntax

json syntax isn't just what JavaScript accepts. For example:

see also JavaScript: JSON Methods

〔➤see Python: Read/Write to JSON

HTTP Protocol Tutorial (new)

CSS Random Gradient with JavaScript, at CSS Linear Gradient Tutorial

CSS Radial Gradient Tutorial (minor update)

Like what you read? Buy JavaScript in Depth
or, buy something from my keyboard store