Wednesday, December 19, 2012

HTML5 Definition Complete, W3C Moves to Interoperability Testing and Performance

W3C published today the complete definition of the HTML5 and Canvas 2D specifications. Though not yet W3C standards, these specifications are now feature complete, meaning businesses and developers have a stable target for implementation and planning. "As of today, businesses know what they can rely on for HTML5 in the coming years, and what their customers will demand," said Jeff Jaffe, W3C CEO. HTML5 is the cornerstone of the Open Web Platform, a full programming environment for cross-platform applications with access to device capabilities; video and animations; graphics; style, typography, and other tools for digital publishing; extensive network capabilities; and more. Read the full press release and W3C Member testimonials.

Thursday, December 13, 2012

You should use JSON.stringify() and json2.js

Do you find often writing code like the following:

$.ajax({
   url:'/xxx/yyy',
   data: '{action:' + action + ', id:' + id + '}',
   success: function (data) {
      console.log('ajax success...');
   },
   error: function (request, status, error) {
      console.log('ajax error...');
   }
});

Don’t do like that anymore, this code is ugly and buggy! You know that you should use JSON.stringify() for serializing ajax data parameters, don’t you? Buggy code should be changed to the following version:

var args = { 'action': action, 'id': id };
$.ajax({
   url:'/xxx/yyy',
   data: JSON.stringify(args),
   success: function (data) {
      console.log('ajax success...');
   },
   error: function (request, status, error) {
      console.log('ajax error...');
   }
});

Many modern browsers have native implementation for JSON.stringify(). For old ones you should use json2.js. The script automatically makes sure it only adds a JSON.stringify() method if it doesn't already exist so there is no danger including it in a browser that already has native support.

Thursday, December 6, 2012

A Few New Things Coming To JavaScript (link)

I believe the day-to-day practice of writing JavaScript is going to change dramatically for the better when ECMAScript.next arrives. The coming year is going to be an exciting time for developers as features proposed or finalised for the next versions of the language start to become more widely available.

In this post, I will review some of the features I'm personally looking forward to landing and being used in 2013 and beyond.

Read more...

Tuesday, December 4, 2012

Voyager 1 spots new region at the edge of the Solar System (link)

Several years ago the Voyager spacecraft neared the edge of the Solar System, where the solar wind and magnetic field started to be influenced by the pressure from the interstellar medium that surrounds them. But the expected breakthrough to interstellar space appeared to be indefinitely put on hold; instead, the particles and magnetic field lines in the area seemed to be sending mixed signals about the Voyagers' escape.

Read more...

Saturday, December 1, 2012

Dont Be Clever (link)

I've come across way to much clever code. If your writing code that you think is clever, just stop it.

- Scott Radcliff

Read more...