Today's Question:  What weekend projects have you created?        GIVE A SHOUT



  Why does LinkedIn migrate to NodeJS from Ruby?

Node.js, the server-side JavaScript-based software platform used to build scalable network applications, has been all the rage among many developers for the past couple of years. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Because of these advantages, there are many websites are migrating to Node.js.One of them is LinkedIn. LinkedIn was initially built on Ruby...

11,953 0          RUBY LINKEDIN NODEJS

  An alternative way to parse URL in JavaScript

Normally when we need to process URL in JavaScript, we may use the location object. Then we can use location.hostname,location.href,location.port etc to get the information we need. In this post, we will parse an URL with an alternative way. We can use an URL to create a DOM object by calling document.createElement("a"). The complete code is: function parseURL(url) { var a = document.createElement('a'); a.href = url; return { source: url, protocol: a.protocol.replace(':',''), host: a.ho...

6,109 1          URL LOCATION PARSE

  JS code to check different mobile devices

Today I come across a code snippet which uses JavaScript to check different mobile devices and then loads different CSS files accordingly. As we know that there are mobile devices with different screen sizes, it's always troublesome for web developers to develop cross browser and cross device compatible codes. Hope this one can help those who develop web apps on mobile devices. // Check whether it's a mobile device // 20130716 if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (...


  JavaScript finite state machine

Finite state machine is a very useful design model, it can be used to simulate many events in the world. In short, finite state machine has three features: Number of states is finite At any moment, one object can only be in one state In some condition, it will transfer from one state to another state In JavaScript, finite state machine can be applied in many places. For example, one menu element on a webpage. When the mouse hovers on the menu, the menu will show up, while the mouse moves away...


  20 cool jQuery countdown scripts and plugins

Have you ever seen the count down component of Apple before its app downloads reached 50 billion times? It's really cool. On a website, we often need to have a count down function, for example, when a e-commerce site initiates some promotions or some organizations want to start an event. In this post, we introduce some cool jQuery countdown scripts and plugins. Circular Countdown jQuery Plugin MORE INFO / DEMO Coconut – Jquery Countdown Plugin - MORE INFO / DEMO ...


  No support of $.browser in jQuery 1.9

Starting from jQuery 1.9, $.browser is no longer supported to detect the nrpwser type and version. The substitute is $.support. In the newer jQuery 2.x versions, IE 6/7/8 are also not supported. If users want to support IE 6/7/8, they must use jQuery 1.9. If you want to fully support IE and want to use jQuery 1.9 and jQuery 2.0, the official solution is: <!--[if lt IE 9]> <script src='jquery-1.9.0.js'></script> <![endif]--> <!--[if gte IE 9]> <script src=...


  JavaScript tips both novice and veteran developers can benefit from

In this post, we will share some less known but powerful JavaScript tips which can benefit both novice and veteran JavaScript developers. 1. Truncate array with array length We all know that object are passed by reference in JavaScript, but we may be bitten by this rule. Please check below example: var arr1 = arr2 = [1, 2, 3]; //Change arr1 arr1 = []; // arr2 will still be [1,2,3] arr1 and arr2 point to the same array [1,2,3] initially, later when arr1 repoints to [], the reference to arr2 is n...

12,924 0          JAVASCRIPT ARRAY PUSH

  Tips to improve JavaScript efficiency

Writing JavaScript code is tedious and error prone. You not only need to implement the necessary functions, but also need to ensure cross browser compatibility. This often causes the low efficiency of JavaScript developers. Here we recommend 12 tips you can benefit from. 1. Remove array element by index If we want to remove one element in an array, we can use splice. function removeByIndex(arr, index) { arr.splice(index, 1); } test = new Array(); test[0] = ’Apple’; test[1] = &rsq...

4,616 0          JAVASCRIPT TIPS ARRAY