Home » JavaScript (page 30)

JavaScript

Javascript Array Length Example

Every programmer learning a new language has to study the way it manages arrays and their size. In native Javascript, length is a property of every array and obviously it is used to retrieve or set the length of that array. The length property is a part of the Array prototype and may be a non-negative integer less then 232. ...

Read More »

Javascript Array Push Example

There are times when you’ve been coding for too long and you don’t remember where exactly did you initialize your array type variable. If you’re too lazy or too strapped for time to search for it and add another element, then you have the means to do that right then and there, without any effort. The following shows you how. ...

Read More »

Pack It Up, Pack It In

Let me begin with a list of usual suspects up to no good in the browser: CoffeeScript (or TypeScript) Less (or Sass/Scss) Jade (or Handlebars, Mustache) I mean, because, you know, writing in HTML/JS/CSS is so 2000-late. All this 74 72 61 6e s p i l a t i o n. A typical layout. Something like this: You’re using ...

Read More »

The mystery of no flash session variables in Express + Passport auth

Someday I started an application using NodeJS with ExpressJS framework and decided to use passport for authenticate the users. As many other times I wanted to use flash messages so, when user authentication fails, the application shows a message informing about bad credentials. Nothing new on the horizon until…. OMG !!! I can’t see the flash messages !!! Disclaimer: This is ...

Read More »

Javascript History Back Example

Everyone who has ever used a computer knows what the Back Button is. We’ve seen it in browsers, apps, everywhere. It is claimed to be the second most used navigation feature again, and according to Mozilla, it is their most clicked Firefox button. If users (and you too) find this feature this useful, why in the world would you not ...

Read More »

Declarative Beats Imperative: Transforming Data In JavaScript

The product I am working on is a fairly typical web application, based on React.js and Node.js. Its main task is to fetch data from different REST-ish services, combine them, and present them in an attractive manner to users. This data extraction and transformation – keeping only the items and properties we care about and structuring them in a way ...

Read More »

Did AngularJS Borrow Some Concepts from JSF?

Since Appery.io added support for Bootstrap and AngularJS, I have been using these frameworks a lot. Many years ago I have been using and teaching JSF and RichFaces frameworks. Surprisingly (or not), I see some concept similarities between AnguarJS and JSF. Obviously AngularJS and JSF are very different frameworks, but they do share some concepts. Let’s look at a simple ...

Read More »

Angular.js Controller Example

Hello! In today’s example we ‘ll see how do Angular’s controllers work. To get into this, I chose a simple form concept, where the user is prompt to insert his username. This updates an informative message (i.e. “Your username is “); I’ll also include a reset button, for demonstration purposes. 1. Required Background Before getting into the technical part of ...

Read More »

Want to take your WEB dev skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • PHP Programming Cookbook
  • jQuery Programming Cookbook
  • Bootstrap Programming Cookbook
  • Building WEB Apps with Node.js
  • CSS Programming Cookbook
  • HTML5 Programming Cookbook
  • AngularJS Programming Cookbook