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

SEARCH KEYWORD -- javascript



  The Future of JavaScript � take a peek today!

The ECMA committee is working hard on designing the next version of JavaScript, also known as "Harmony". It is due by the end of next year and it is going to be the most comprehensive upgrade in the history of this language. Chrome and V8 are committed to pushing JavaScript forward and have already started implementing the new features. You can try some of them today in the latest dev channel release. Here’s a summary: Lexical scoping. Now "let" is the new "var" – traditional "var...

   JavaScript,Future,Feature     2012-02-12 04:56:37

  Understand this in JavaScript

In JavaScript, this is always pointing to the owner of a function or a method. Function Let's check out function first. function introduce() {      alert("Hello, I am Laruence\r\n"); } For this function, what does this point to? In JavaScript, a global function's owner is the current page, i.e, the window object. Because its a method of the window object if we define a global function. Now you should know the this will point to the window object in the above function. ...

   JavaScript,this,event,call     2013-04-03 04:10:03

  trim() in JavaScript

In the past, JavaScript didn't define the trim() function for String object. This makes web programmers frustrated since they often need to implement this function themselves if they want to handle user inputs. The new version of ECMA-262 introduces the trim() function.15.5.4.20   String.prototype.trim ( )     The following steps are taken:     1.   Call CheckObjectCoercible passing the this value as its argument.   2.   Let S...

   JavaScript,trim(),implementation     2012-07-19 10:58:01

  Load and execute JavaScript

When we load and execute JavaScript in a webpage, there are many points we need to care about because of its design and feature. There are two features about JavaScript execution in a browser: 1). The JavaScript codes will be executed immediately once loaded;2). When JavaScript codes are being executed, they will block the following contents (including page rendering and other resources downloading). So if there are multiple js files to be loaded, these codes will be executed sequentially. Since...

   JavaScript,async,defer,load,execute     2013-06-07 04:53:46

  The future smells like JavaScript

Of course I am only repeating what others are preaching about the recent rise of JavaScript. But I think the movement is significant and can't be overstated. And recent developments are really even making it more and more interesting. Nobody can deny hat JavaScript is the de facto programming language of Html5. Every other language trying to bolt itself onto Html5 looks like pure friction so far. And Html5 is looking upon a prospering future. Today we are used to some established JavaScri...

   JavaScript,Future,Node.js,Client-side     2012-02-03 08:06:43

  ECMAScript 6 looks promising

I am quite excited about ECMAScript 6, after watching David Herman’s talk at YUIConf 2011. I am especially looking forward to seeing some of these features landing up on V8 soon, so that I can use it on node.js. These additions will solve many common sources of frustration that newcomers face when working with JavaScript. Although the spec is not expected to be finalized till 2013 (so says David in the video), a lot of these features are expected to hit Chrome and Firefox much befor...

   ECMAScript 6,JavaScript,new feature,let,template     2011-12-07 03:21:40

  Mastering Async/Await in JavaScript: A Comprehensive Guide with Examples

As a veteran JavaScript developer, I have seen the evolution of JavaScript's asynchronous programming landscape. From callbacks to promises and now async/await, JavaScript has come a long way in making it easier to handle asynchronous operations in a clean and readable manner. In this article, we will delve into the world of async/await and explore why it has become a popular choice for handling asynchronous operations in JavaScript. We will cover the basics of async/await, its syntax, and how i...

   JAVASCRIPT,COMPARISON,PROMISE,ASYNC AWAIT     2023-02-12 07:26:15

  How to handle ES6 modules in NodeJS

In modern JavaScript, there are two types of modules: ES6 module and CommonJS module used by NodeJS. These two types of module are not compatible. Many people would wonder how to load ES6 modules in their NodeJS project. This post will show how this can be done. Difference The syntax of the module being loaded is different. CommonJS modules are loaded with require() and exported with module.exports. ES6 modules are loaded and exported using import and export respectively. Merchanismwise require(...

   NODEJS,COMMONJS,ES6     2020-08-28 22:01:33

  CSS Animation vs. JavaScript: Which One Is Better?

You know that there are two ways of creating animations on the web: with CSS and JavaScript. And, their selection completely depends on the dependencies of the project. But many web developers hold a wrong perception that CSS is the only way of creating the animations. In fact, CSS has established as the most pampered system of the web development industry and most of the developers recommend it because it is mobile-friendly and powerful system. No doubt CSS is good, but JavaScript is the best....

   CSS animation, JS animation     2015-07-24 02:45:01

  How to choose JavaScript template engine?

With the increase of density of web front end development, AJAX and JSON are used more and more frequently, it's necessary to use many tags in front end development. You may have a JSON object as below: var data={  email: 'terry.li@gbin1.com,  gender: 'male'  } Then you need to organize the JSON data into page elements. var email, gender;email= ' ' + data.email+ '; gender= ' ' + data.gender + '; $('#contentwrapper‘).append(content).append(gender); The output is very simple: ...

   JavaScript template engine,Template     2012-10-07 07:03:58