When you develop an application, most, if not all, of the times, you will have to provide some way for your users to upload files, for example to update their profile picture or to share a document. In this example, we will see how we can implement this using jQuery. Table Of ...
Read More »Home » JavaScript »
Javascript String Replace Example
Ever wrote an entire post about the simmilarities between two programming languages, and realized at the end of your 1000 word essay that “simmilarities” is actually written as “similarities”? Now you’d have to change that, and it’s horrible because you actually used that word like a dozen times! I would know that, as the engineering student who learned how to ...
Read More »Learning Angular: Set your language culture before any UI is displayed
In this article I briefly outline an issue I had, namely to make sure that my language’s locale files are loaded by angular-translate before any UI is shown. First, this prevents from any unwanted flickering and second it helps to avoid wrong displaying of localized data. But see for yourself. This article is part of my “Learning NG” series, presenting ...
Read More »JavaScript Inheritance Example
EDITORIAL NOTE: In this post, we feature a comprehensive JavaScript Inheritance Example. In object-oriented programming, inheritance enables new objects to take on the properties of existing objects. A class that is used as the basis for inheritance is called a super-class or base class. A class that inherits from a super-class is called a subclass or derived class. JavaScript is ...
Read More »Angular.js Form Validation Example
EDITORIAL NOTE: In this post, we feature a comprehensive Angular.js Form Validation Example. One of AngularJS advantages is the simplicity it provides for validating forms. Today’s example demonstrates a simple way to implement client-side validation using the AngularJS form properties. Suppose a form with two fields, username and email and two buttons, one for reset and the other with a submit ...
Read More »Top 20 jQuery Interview Questions and Answers for JavaScript Programmers
Without a doubt, jQuery has given a much needed boost to JavaScript, a language so useful but equally underrated at times. Before jQuery came into picture, we used to write lengthy JavaScript code not just for bigger but even for smaller applications. That code was at times both difficult to read and maintain. Having written plain JavaScript before using this ...
Read More »AngularJs as the alternative choice for building web interface
Recently, we were invited to conduct a joint talk with a UX designer, Andrew from Viki on Improving communications between Design and Development for Singasug. The main focus of the talk was to introduce AngularJS and elaborate on how it help to improve collaboration between developers and designer from both sides of view. To illustrate the topic, we work together on revamping the ...
Read More »Generate Mazes in AngularJS with 8-Bit Algorithms
I started programming on 8-bit machines. Back then it was normal to do amazing things with a mere 64 kilobytes of memory on a CPU that clocked in at 2.6 Megahertz. No, those aren’t typos, and I meant “mega-” not “giga-”. In those days we were forced to do a lot with a little, and “optimizing code” meant choosing op ...
Read More »Learning Angular: Verifying whether a function has been passed to my directive’s isolated scope
When you create isolated directives, you usually use the scope property to define your directive’s external API. Some of the APIs properties might be mandatory while others are optional and based on that state, your directive might react differently. Sounds easy, but I stumbled upon a difference when you pass in functions vs. data objects. See yourself. This article is ...
Read More »