Xah's Web Dev Blog

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

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? Please tell friends, share link, or Buy JavaScript in Depth. Thanks.