Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 WEB


  JavaScript Is Not A Language

Recently people presented arguments for and against using CoffeeScript. I felt the argument against was pointless and obviously wrong, but I couldn't figure out why, and I thought the counterargument for was kind of toothless and irrelevant. I've figured out the real issue.The real argument for CoffeeScript is that JavaScript is not really a language.Years ago I read something which explained, in my opinion, why Lisp has never achieved the mainstream adoption its passionate advocates believe it deserves. Lisp projects experience a degree of balkanization because everything is left wide open; y...

4,494 0       JAVASCRIPT MODEL NOT A LANGUAGE COFFEESCRIPT


  Open Letter to sites with annoying interfaces

Remember those childhood games where you are given two nearly identical images and your objective was to find some number of subtle differences? Well, I shouldn't have to play that game when I'm using your damn website.I show here two examples of a common practice that is plaguing the modern web. First, a clipping from a project page on github.com.  And now the second image:  See the difference? My question is this: why? That edit button is the only component of the entire page that has a hide-by-default-unless-your-mouse-is-in-a-certain-vertical-and-horizontal-range behavi...

2,695 0       WEB DESIGN USER INTERFACE USER FRIENDLY LAYOUT


  Advanced event registration models

On this page I explain the two advanced event registration models:W3C’s and Microsoft’s. Since neither is cross–browser supported,their use is, for the moment, deprecated.W3C and Microsoft have both developed their own event registration modelto replace Netscape’straditional model. Though I’m notimpressed by the Microsoft model, W3C’s is very good, except for onecrucial vagueness.Unfortunately few browsers support it at the moment.W3CW3C’sDOM Level 2 Event specification pays careful attentionto the problems of the traditional model. It offers a ...

2,515 0       JAVASCRIPT EVENT MODEL THIS BUBBLE CAPTURING


  Execute PHP from a .html File

How can I execute PHP code on my existing myfile.html page?:When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it sends it right to the browser because it doesn't have anything to process on the server. If it sees a .php extension (or .shtml, or .asp, etc), it knows that it needs to execute the appropriate code before passing it along to the browser. Here is the problem: You find the perfect script, and you want to run it on your site, but you need to included PHP on your page for it to work. You ...

6,848 0       PHP HTML PHP IN HTML ADDTYPE


  In 2012, let’s stop talking web design and start talking product design

“My hope for 2012 is that some of the old guard of well-respected web gurus stop talking HTML and CSS and start talking serious development. I love the way many of the old guard write and evangelize, but I’m tired of discussing basically the same stuff we were in 2006.”I wasn’t specifically referring to Jeffrey Zeldman, but he (somewhat arrogantly) assumed I was, and responded with a sarcastic, “And a merry Christmas to you, sir.” And while I wasn’t thinking of Zeldman and his books, conferences, and magazi...

2,492 0       WEB DESIGN MODEL 2012 MODULE FOCUS


  Using PHP sessions across subdomains

By default, PHP uses the 'PHPSESSID' cookie to propagate session data across multiple pages, and by default it uses the current top-level domain and subdomain in the cookie declaration.Example: www.domain.comThe downside to this is that the session data can't travel with you to other subdomains. So if you started a session on www.domain.com, the session data would become unavailable on forums.domain.com. The solution is to change the domain PHP uses when it sets the 'PHPSESSID' cookie.Assuming you have an init file that you include at the top of every PHP page, you can use the ini_set() functi...

26,549 0       PHP SESSION SUBDOMAIN AVAILABILITY


  A String is not an Error

I decided to write a little article to discourage an unfortunately common pattern in Node.JS modules (and browser JavaScript, to a lesser extent) that can boil down to these two examples:// A:function myFunction () {  if (somethingWrong) {    throw 'This is my error'  }  return allGood;}and// B: async Node.JS-style callback with signature `fn(err, …)`function myFunction (callback) {  doSomethingAsync(function () {    // …    if (somethingWrong) {      callback('This is my error')    } else {    &nb...

3,444 0       JAVASCRIPT NODE.JS STRING ERROR OBJECT


  JavaScript as a First Language

At Khan Academy we've been investigating teaching Computer Science to students in some new and interesting ways. The most interesting aspect of which is that we're likely going to be teaching them JavaScript as their first language.We're in a very unique position as we're primarily aiming to teach students who've been through our previous math and science-centric curriculum. Because of this we can create some rather compelling exercises and projects that never would've been feasible otherwise.The prospect of teaching the JavaScript language as a first language is actually really exciting. Teac...

5,816 0       PROTOTYPE JAVASCRIPT LEARNING FIRST LANGUAGE INHERITENCE