Home » JavaScript » Page 29

JavaScript

Creating a hash in Node.js

Introduction We require hashes everywhere, like setting the password in database as hash instead of plain text password, to check whether if file is tampered or not during transmission or checking integrity of file or messages transferred over network, etc. This small article will give detailed look at creating hash from Node.js core crypto module and later in the article, it shows how ...

Read More »

Lazy inter-module communication with require() and webpack

Motivation CommonJS’ modules can be loaded on demand with require.ensure(…). Example: require.ensure(["module-a"], function(require) { var a = require("module-a"); // module-a can be used now ... }); The well-known module bundler Webpack supports this syntax for loading modules on demand. Such lazy loaded module(s) define a split point. Split points split the codebase into “chunks” (separate JavaScript files) which are loaded on demand. This ...

Read More »

First steps with Angular 2: 8 cool features

I’ve been doing some work the last couple of weeks with Angular2. I really like it. Not just because it uses typescript, but also because it feels really natural and straightforward while working with it. No more string based dependency injection, or strange digest cycle stuff, it just seems to work. This last week I’ve migrated our beta-13 Angular app ...

Read More »

Javascript Timer Example

The aim of this example is to explain the timing events in javascript. The javascript window.setTimeout(function, milliseconds) function is used to execute a function, after waiting a specified number of milliseconds. This method returns a timeout id.                   Notice, setTimeout and window.setTimeout are essentially the same, the only difference being that in ...

Read More »

ES6 and beyond – What i really like

Hi dear software companions. It has been a long time. A lot had happened in between. I even changed a residence :) But enough about me. Let’s talk some JavaScript. Recently i have read a book called You Don’t Know JS: ES6 & Beyond written by Kyle Simpson. I was fully overwhelmed with the amount of new features and syntax shortcuts (or ...

Read More »

Angular.js Single Page Application Example

Angular.js is one of the frameworks in the programming world that is acutely becoming one of the most widely-used of them, as it’s incomparable in providing us with the means to create dynamic and efficient web-apps. There are a number of useful features that have made Angular not only famous for, but also irreplaceable in web-developing. One of these features ...

Read More »

Angular.js $location Example

One of the scenarios that you may have encountered while using AngularJS in your project is having to use the current URL of the website. It becomes especially important when you have to do routing or when the current URL is crucial to the well-functioning of your web-app. There’s an AngularJS service we use whenever we have to deal with ...

Read More »

Unobtrusive JavaScript via AJAX in Rails

For now, the main way to add dynamic content to a webpage is with JavaScript. Ideally, we want to update a site’s contents from the server without reloading the page. Let’s take a look at how we can accomplish this with AJAX in Rails. Now, many of the brief AJAX examples I’ve come across show variations of retrieving collections of data ...

Read More »

Blind Date with AngularJS

Are you starting to work on a new application that is using AngularJS? You have heard of it before and would like to know more about it? And have no idea where to start? You are in luck! Continue reading this blog and start learning this hot thing called Angular! AngularJS is a JavaScript MVC framework that has some compelling ...

Read More »