Xah Web Dev Blog Archive 2016-04

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

side panel UI scrollbar user interface design poll 2016 06 27
User Interface design: navigation panel, scrollbar vs no scrollbar, poll result.

JavaScript Load Order (rewrote. improved clarity)

JS: 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!)

JS: 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

JS: 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 JS: Array.prototype.splice

JS: Array.prototype.reduce (new page. Basic example.)

JS: Compute Date Range

Understand Atomic CSS in 1 Minute

JS: Flatten Nested Array

see also JS: Array How-To

JS: Array.prototype.every

JS: Test Equality of Objects

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

JS: Compare Array Equality (updated)

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 JS: Array.prototype.splice

JS: 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.

JS: Replace All Children, createDocumentFragment

JS: Randomize 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 Python: Read/Write to JSON]

HTTP Protocol Tutorial (new)

CSS Random Gradient with JavaScript, at CSS: Linear Gradient

CSS: Radial Gradient (minor update)

Ask me question on patreon