Xah's Web Dev Blog

Tutorial on {HTML, CSS, JavaScript, …} + gossip on {Google, Internet, SEO, Spam, …}.

Web Tech: DOM Suck

Visual Dictionary of CSS. Now, there's side panel for easy navigation, for all pages.

JavaScript in Depth. Now each page has a side-panel, for easy navigation.

The Story of XML

ECMAScript 2015 Set Object's Parent

In ECMAScript 2015, a new function Object.setPrototypeOf(obj, parent) lets you set/change parent. (that is, effectively setting the [[prototype]] internal slot.) ECMAScript 2015 §Fundamental Objects#sec-object.setprototypeof

You should never change a object parent object. Because, for complex JavaScript implementation reasons, doing that is very slow. Instead, you should create a new object with the right parent. 〔➤ JavaScript: How to Create Object with Parent X?

see also JavaScript: Property Named “prototype”

JS+DOM: What Does Live Object Mean? (major update)

JavaScript: Event Delegation (updated. new code example, functional programing style)

JavaScript: Add / Remove Event Handler (updated)

JavaScript Execution Order (updated)

JavaScript: String Methods for Regex. Major update. Examples are on a page of their own.

the one html tag that summarize just how fucked the web standards & fashions in past decade is: iframe

JavaScript Encode URL, Escape String (updated)

JavaScript: Tagged Template String

JavaScript: Template String

Global Internet Usage Hour Pattern. Guess when is internet most busy in usa, and when in china. local time.

JavaScript wuwu quiz

// quiz. figure out what does this code do
// 2015-10-29

function foo() {
    var eleName = document.getElementById("x79177");
        (function(le) {
            return function(f) {
                return f(f);
            } (function(f) {
                return le(
                    function(x) { return (f(f))(x); }
        }) (function (givenGetDepth) {
            return function (element) {
                return (element === null) ? 0 : givenGetDepth(element.parentNode) + 1;
        }) (document.getElementById(eleName))


JavaScript: Property Named “prototype” (new page)

JavaScript: “undefined” (new page)

JavaScript: What's “null” Used For? (new page.)

is xml dead related search 2015-10-17
is XML dead?

On a different note, James Clark (programmer), the top expert of XML, his last blog entry is 5 years ago http://blog.jclark.com/

XML and XHTML is a sad story. Excellent tech, but blown up by enterprise. Now we have the HTML5 soup, back to the roots of random soup.

web design gray text on white Joe Arms Erlang 2015-10-16
can you read the grey text?

another gray on white. This one from the inventor of erlang language. Web Design: Say No to Grey Text on White Background

Buy JavaScript in Depth. New version is out.

This is early stage of selling my tutorial. If you enjoyed it, please help me spread the word. Leave a comment at JavaScript in Depth. Thanks.

major re-organization of the js+dom table of contents page. JavaScript+DOM Tutorial

v8 comilation quirk: char count

these 2 JavaScript code, one is twice as slow, because its comment has a few 4 more chars.

#NodeJS : A quick optimization advice By Jefferson Rafael K. @ https://medium.com/@c2c/nodejs-a-quick-optimization-advice-7353b820c92e

web dev front-end and back-end

the original work: 1600×996. Artist is Hans Arnold.

upgrade to latest node.js (v4.x), then you'll have latest es6 support as Google Chrome browser.

write once, run anywhere. —JavaScript

JavaScript Books Review

JavaScript quiz of the day. true or false?

function f () {};
Function.prototype = 3;
console.log( f instanceof Function );

refresh here JavaScript “instanceof” Operator, but that still may not answer why.

puzzling? discuss at https://plus.google.com/+XahLee/posts/CLMxi9LGteG


this will silently fail.

// silently fail
Function.prototype = 3;

If you add "use strict", then error is reported.

"use strict";
Function.prototype = 3;

// Function.prototype = 3;
//                    ^
// TypeError: Cannot assign to read only property 'prototype' of function Function() { [native code] }

You cannot change Function.prototype, because the “prototype” property there does not have “writable” attribute.


// output:
// { value: [Function: Empty],
//   writable: false,
//   enumerable: false,
//   configurable: false }

JavaScript: Property Attributes: Writable, Enumerable, Configurable

HTML Input Range: Slider UI

JavaScript: SVG Clock (updated. Using svg transform instead for moving the hands.) 〔➤ SVG: Coordinate Transformation

get local copy of html5 spec

the whatwg group finally made building their html5 spec simple. git and build your own for local reading. https://github.com/whatwg/html-build

SVG Path: Elliptical Arc (new)

emacs google plus girl profile spam 2015-09-24 46957
Pretty Girl Spam

now i succumb to the tyranny of JSDoc. http://usejsdoc.org/

JavaScript: Should You Move Variables to the Top? (updated.)

How to Disable JavaScript, Flash, Java in Google Chrome, Firefox, Internet Explorer (repost)

JavaScript: ƒ.call, ƒ.apply, ƒ.bind (major rewrite)

JavaScript: How to Get Max/Min Value of a Array? (on its own page)

Web Spam, Scam, Blackhat SEO Collection

CSS: What's a CSS Pixel? What's Reference Pixel? (rewritten)

Past Articles by Date


Like what you read? Buy JavaScript in Depth. Thanks.