Home » JavaScript (page 35)

JavaScript

A Java Developer’s Perspective on the Power and Danger of JavaScript’s Object Prototype

In the Anti-Patterns section of the book Learning JavaScript Design Patterns, author Addy Osmani calls “Modifying the Object class prototype” a “particularly bad anti-pattern.” One of the interesting (and scary) aspects of this is that a developer can change the behavior for all JavaScript objects with one definition. This is analogous to what would be possible in Java if a ...

Read More »

Angular.js Table Example

Hi there! Today we ‘ll examine a simple table solution, using the Angular.js framework. Suppose we want to display a list of persons, accompanied with their hobbies, in the gentle packaging of an HTML table. Let’s see the way over it!               1. Introduction If you ‘re not enough experienced with Angular, you should ...

Read More »

The Top 5 Mistakes AngularJS Developers Make Part 4: Hacking the DOM

  This is the fourth part in a five-part series that covers common AngularJS mistakes. To recap, the top five mistakes I see people make are: Heavy reliance on $scope (not using controller as) Abusing $watch Overusing $broadcast and $emit Hacking the DOM Failing to Test In the previous posts I’ve covered some nuances around controllers and how they communicate ...

Read More »

JavaScript Tutorial – Part 5: Statements

While theoretically we can do anything with functions and simple data structures, but for some strange reasons programmers (unlike mathematicians) like their code to be readable and understandable by other human beings. So programming languages (and of course, JavaScript) have some build in statements to help us create more readable and easier to understand programs. We have the usual suspects: ...

Read More »

The Top 5 Mistakes AngularJS Developers Make Part 1: Relying on scope

Although AngularJS is an extraordinarily popular framework, there is plenty of discussion and controversy over whether or not it truly adds value to projects. Having witnessed its value firsthand as I described in my recent post, Angular from a Different Angle, I believe it can be a powerful tool when used correctly. Voltaire said, “With great power comes great responsibility.” ...

Read More »

jQuery mouseover example

Javascript is essentially a very good tool for tracking events on a web page and changing some view options after user actions. We can track mouse clicks, mouse movements, key’s ups and downs and a lot of other user activity. All this stuff can be done using jQuery and in this article we’ll consider its approach how to perform actions ...

Read More »