Home / JavaScript

JavaScript

SonarQube our ally to improve the webapp projects

Hi all, Today I would like to comment on an indispensable (free)software in the continuous delivery of our projects. The official definition is: “SonarQube provides the capability to not only show health of an application but also to highlight issues newly introduced. With a Quality Gate in place, you can …

Read More »

Creating HashMap in UI5

  A data structure is a reusable entity which can perform this operation. We have few entities already used in javascript like arrays,weakmaps etc . However in  SAP UI5 libraries HashMap is not available .It can serve numerous functions for transactional data in front-end component . Few of them are …

Read More »

April Tip: Google Charts and XSODATA

Time and time again I work on something and then forget to save the snippet, document it or even make a note of where I did it. Then after awhile I need it again and have to hunt for it or figure it out again. So today I decided to …

Read More »

Step by step to host your web application to Github

1. Create a new empty github repository: The local project has the following folder structure: lib( folder )    |- angular.js angular_controller.html Follow the instructions in above picture to push the local project to github. Once done, it should look like below: 2. use command git checkout –orphan gh-pages to …

Read More »

Fun but Fake JavaScript translator

Yesterday I posted a #tbt post about using JavaScript to dynamically change images. It was no real “business” purpose behind the post more just something fun and different and a break from the norm. Last night I remembered something I had done back in High School with Turbo Pascal and …

Read More »

#tbt JavaScript and changing images

Years ago before all the fancy CSS and different cool HTML5 features we had to get creative with images and how to change them on the “fly”… granted I still remember when “blink” was added to HTML and celebrated when it was removed. So I decided to see if I …

Read More »

Automate the Boring Stuff with Python

We recently decided to provide In-App help using the xRay framework for one of the tools that my team develops. One of the requirements of the tool was that the IDs of the controls should be stable. By the definition in their documentation, a stable ID is one which: Does …

Read More »

JavaScript Threading – The Magic Framework Problem

@Joseph Berg made an excellent comment in my last post (Stop Punishing the Users.  Eliminate the Wait.).  And it brings up a very valid issue, which deserves it’s own separate posting. In my previous post, I identified two major OData issues that should be dealt with at design time: violating the MVC …

Read More »

How to get and debug converted source code in React

Source code: https://github.com/i042416/react-demos/blob/master/demo02/index.html If you would like to debug line 20 and 24 and set a JavaScript breakpoint there, the breakpoint can never be triggered, since the source code is written with a combination of both JS and JSX( the code wrapped with “<>” will be parsed based on HTML …

Read More »

Some JavaScript closure example

Example1 – AJAX callback before we use Closure after we use Closure Example 2 – Resource Lazy load design Solution version 1 Solution version 2 Solution version 3 Solution version 4 Final solution Before we start, let’s look into the code below. What will be displayed in alert popup? When …

Read More »

How to Unit Test Custom Exceptions with QUnit

When writing robust JavaScript code, you will probably want to throw exceptions to let programmers know when they’ve misused your API. Sure, you could throw an instance of the built-in Error object, but then during unit testing how will you tell if the exception you’re seeing is yours and not …

Read More »