Home » JavaScript (page 30)

JavaScript

Javascript Textbox Example

However convenient, forms have been a nightmare for developers for a long time, because they had a very important and difficult requirement to fulfill: transferring data from the client to the server. When Javascript came to be a regular in the playground, there was one ability which made it completely establish itself: the ability to completely sidestep this “drawback” of ...

Read More »

Javascript Onclick Example

The aim of this example is to show you how to handle the onclick event. A JavaScript can be executed when an event occurs, like when a user clicks on an HTML element. To execute code when a user clicks on an element, we can add JavaScript code to an HTML onclick event attribute . The onclick event fires on ...

Read More »

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 »

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 »