Home » JavaScript (page 10)

JavaScript

jQuery Select Option Example

The aim of this example is to explain and use various jQuery selectors and methods related to manipulation the select dropdown element of HTML. The <select> element is used to create a drop-down list. The <option> tags inside the element define the available options in the list. These basic HTML elements are the ones we’ll apply special selector and/or methods ...

Read More »

Promises in AngularJS. Part II. $q service.

I have already blogged about Promises in AngularJS 1.x. This is the second part which describes the Angular’s $q service. The $q service can be used in two different ways. The first way mimics the Q library for creating and composing asynchronous promises in JavaScript. The second way mimics the ECMAScript 2015 (ES6) style. Let’s begin with the first way. ...

Read More »

Javascript Textarea Example

If you have applied somewhere online, or asked for a particular thing using the contact forms of the websites, you will most probably have seen those use a text-area field for the argumentation. It is a highly convenient feature of Javascript, and if you now want to add it to your own website, I would completely agree. But how can ...

Read More »

AngularJS MVC Tutorial – Part 2 – Bower, SASS and Grunt

This example is the part 2 of my MVC tutorial with Angular. I strongly suggest you read the part 1 if you have not as it shows how to do the MVC part of the project. Table Of Contents 1. Introduction 2. Bower integration 2.1. Installation 2.1. Initializing a project 3. SASS 4. Grunt 4.1. Setup 4.2. grunt-contrib-clean 4.3. grunt-contrib-sass ...

Read More »

Writing unit tests for Sails.js app using mocha

Sails.js is a wonderful node.js framework. Writing unit tests for Sails.js using mocha is pretty easy. On the before method of a mocha test you have to lift the sails application and on the after function you have to lower it. var Sails = require('sails'); describe('SailsMochaTest',function() { before(function(done) { this.timeout(50000); Sails.lift({}, function(err,server) { if(err) { done(err); } else { done(err,sails); ...

Read More »

JSON-LD: Building Meaningful Data APIs

Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share that meaning via documentation, conversation, or usage, but those often exist in places far removed from the JSON document you’re looking at. What if the meaning itself was encoded directly into the document? What ...

Read More »

How to run Angular 2 in Production Today

Recently there where announcements that made clear that the Angular 2 final release is just around the corner. This might be as early as mid-May during Google IO ! But thats still several months into the future, and there are many projects that will start between now and then. A question that gets asked a lot these days is: should ...

Read More »

Grunt RequireJS Example

Table Of Contents 1. Grunt 2. RequireJS 3. Grunt with RequireJS 4. Example 5. Summary 6. Download 7. Links 1. Grunt The main pre requisite that you need in order to follow this example is to have NodeJS installed in your environment. You can check the installation instructions here https://nodejs.org/en/. Grunt is a JavaScript based task runner. It is quite ...

Read More »

Automate your front-end development environment with npm

For JavaScript development, there are more build tools than you know what to do with. The non-verbal utterance category contains the two most popular ones, Grunt, and Gulp. Then you have your food-related tools, like Brunch, Mimosa and Broccoli. You’ve got fancy new hot stuff like fly. Then there’s classic make-like tools like Cake, Jake and ShellJS’s make. Some folks just ...

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