Home » JavaScript (page 35)

JavaScript

JavaScript String Contains Example

Usually, programming languages have a special preprocessed function to find a substring of a string. But what happens when you language of choice doesn’t have one? Well the answer to that is: You make one! How exactly do you write such function in JavaScript, we are going to show you below. Does a ready made function exist? It does! If ...

Read More »

Avoid test code duplication in Jasmine tests

Test code has to be treated like production code. Obviously we cannot charge the customer for it, it’s something that helps us developers to make sure we keep our codebase healthy, which ultimately is the responsibility we have towards our customers. Thus we need to apply the same best practices principles as we do for our production code, where, code ...

Read More »

Watch file changes and propagate errors with Gulp

Gulp fever infected me. Streaming model is very interesting and modern. After initial excitement, I started to experience first pitfalls. This is understandable for such young project. I am going to describe my problem with watching file changes and propagating errors. Error in Gulp by default breaks the pipe, terminates the build/test and whole Gulp process with some error code. ...

Read More »

JavaScript Form Validation Example

If you’re looking to build an interactive website, which contains any form of input, then you should validate the data you get from the users. If it’s a registration form you have to validate the name and surname fields, the e-mail, username, age, zip code and everything else, so that you don’t send unnecessary calls to your server. Below you’ll ...

Read More »

JavaScript Promises Essentials

JavaScript is asynchronous by definition which is what makes many server-side developers struggle initially. Many even try to avoid asynchronism as much as they can rather than to embrace it. Others end up in a callback mess. That’s where promises come into play! The following code is a typical piece of JavaScript code. Some async function is invoked, passing the ...

Read More »

Part Deux: A Google Calendar Gadget in Angular.js

I was on a project recently where the team was faced with a daunting list of scheduling-related backlog stories. When looking at the entire feature, about 20% of these stories dealt with custom functionality and 80% of them dealt with issues that are common to any scheduling or calendar application: start times, end times, visibility/privacy, conflicts, notifications, etc etc. When I asked ...

Read More »

Web-components like AngularJS directives

As you may already know web components consist out of a set of technologies which are combined to create a custom element for use in your HTML markup. The main additions, as described in several blogposts, are HTML imports, Shadow Dom and Templates combined with isolated scripts and styling. (If these concepts are new to you i suggest you read up ...

Read More »

Do all business logic on the client using JavaScript?

History look The first applications were running on “the” computer. There was nothing like “client” and “server”. There was the computer and the punch card input, printer output. Later the mainframe came and the clients were terminals. Looking back, we can say that this was a two tier architecture with lightweight clients. This was practically the same with the mini ...

Read More »

New Features in AngularJS 1.3

Now that Angular 1.3 has been officially released, I thought I would talk about some of the new features that developers would like to know, to include: Performance improvements One-time bindings ngModel.$validators ngMessages ngModelOptions If you are still using IE 8 as your main browser, first I want to say WHY? Angular 1.3 is dropping support for this old browser. ...

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