Understanding by examples 0 == false Result : True. 0 is automatically converted to boolean. 0 === false Result : False. Don’t … More
Tag: javascript
[NodeJS] – Production best practices: performance and reliability
This article is really nice for you that are working with NodeJS and ExpressJS. You should read to improve your application … More
[NodeJS] – How to automating front-end tasks with Grunt ?
What is Grunt ? The Grunt is a task automation Node.js module . Official WebSite :http://gruntjs.com/ How to install in your … More
How to change the style of a log in the browser console ?
For you change the style of a log in the browser console you can use : console.log(‘%c <string>’, ‘<style>’); It … More
Meteor Js: The shortest path between points project with Neo4J + Meteor JS
About Solution This is a solution for finding the shortest path between points using a graph database (Neo4J) with Meteor … More
Javascript: How to wait N seconds to do something ?
You can use : setTimeout Full Example: function run() { setTimeout(afterSeconds, 10000); } function afterSeconds() { //{…DO SOMWTHING} }
JavaScript + Meteor JS : How to open a link in new window ?
Use : var win = window.open(url, ‘_blank’); win.focus(); Example in a Meteor Js application: clip.file <template name=”Clip”> <div class=”card-container”> {…} … More
JavaScript : Iterating arrays with forEach
array.forEach(function(entry) { alert(entry); } Example : if ( event.attractions ){ var att = []; event.attractions.forEach(function(entry) { if (entry.artist){ att.push(entry.artist); } … More
JavaScript : How to remove some item from an array ?
One way to remove some item is take his position on array and remove by this. Example: var users = … More
Primefaces : How to set the max value for a inputTextarea component ?
You can use this function in Javascript : onkeyup=”if(this.value.length>(max value)){this.value=this.value.substring(0,5);alert(‘(Warning Text)’)}” Example : <h:inputTextarea value=”#{myController.bigtext}” onkeyup=”if(this.value.length>500){this.value=this.value.substring(0,5);alert(‘The maximum value is 500 … More