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

 JAVASCRIPT


  Have you used these JavaScript libraries before?

Are you a vanilla JavaScript developer or a JavaScript library lover?  If you are a vanilla JavaScript developer, please feel free to step away silently because you may not get what you want, but if you are a library or framework lover, please bookmark this page as what we list below are what you may use in the future.There are tons of JavaScript libraries created to ease the headache of developers who have to deal with different browsers on different devices. You may use some of them before such as jQuery.js, Twitter Bootstrap etc. But I bet you have missed some of them. Let's take a loo...

8,535 0       JAVASCRIPT FRAMEWORK LIBRARY


  Undefined property or variable in JavaScript

JavaScript is a weak type language, and also you can use a variable or property where it's undefined. If we don't have correct ways to check whether a property or variable is defined, we may get unexpected results when we try to access the,. How can we check whether a property or variable is undefined?This is actually a somewhat tricky question. Let's start off with some facts about undefined and then see what kind of function is consistent with the ones we care about.JavaScript attaches types to values, not variables. Values can have type undefined; variables either exist (if declared) or the...

11,479 0       JAVASCRIPT ARRAY PROPERTY UNDEFINED


  Inspiring facts about JavaScript

JavaScript has been advocated as the first language to be learned by people who want to program. We have discussed the reasons why we should do so. Recently with the popularity of Node.js, JavaScript has become a full-stack language,  it can be used as both frontend and backend programming language. Today we will give some hard facts which will convince you about the popularity of JavaScript.Just like William Ting said ""JavaScript will stay relevant as long as people use the internet". Yes, JavaScript was created for web, but it's not limited to web; and Internet is bound with web closel...

10,151 1       JAVASCRIPT POPULARITY


  Which one has a worse reputation, JavaScript or PHP?

There has a been a lot of criticism of PHP over being a badly designed programming language. JavaScript seems quite a similar language with loose-typing and flexible array declarations/memory management, but is widely adopted by industry leaders such as Google. Google even has a JavaScript style guide. Many people think that PHP has a worse reputation than JavaScript. Carlos Ribeiro gave his analysis on a high level which doesn't touch the language syntax.Attributing JavaScript success to it being "the only language for the job" is unfair. JavaScript is hands down a much better language than P...

10,295 0       PHP JAVASCRIPT COMPARISON REPUTATION


  You can get properties of pseudo-element using JavaScript now

The pseudo-element6 in CSS is extremely useful, you can use it to create CSS triangles and lots of other elements without overuse many HTML elements. In the past, you cannot get the property value of pseudo-element in CSS using JavaScript. Now you can call a new method in JavaScript to get them easily.Assume you have below CSS codes:.element:before { content: 'NEW'; color: rgb(255, 0, 0);}To get the properties in .element:before, you can use below JavaScript method:var color = window.getComputedStyle( document.querySelector('.element'), ':before').getPropertyValue('color')You can put the pseud...

8,358 0       JAVASCRIPT PROPERTY PSEUDO-ELEMENT


  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 which contained 60K lines of code, later in 2011, LinkedIn started to rebuild their core mobile servi...

15,945 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.hostname, port: a.port, query: a.search, params: (function(){ var ret = {}, seg = a.search.replace(/^\?...

11,355 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// wukong.name 20130716if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEri...

3,221 0       JAVASCRIPT MOBILE DEVICE DETECTION