Skip to content

Tag: javascript

The fragmentation of UI frameworks and structuring for the future

The highway of UI Given the fast moving space in which modern UI frameworks operate, its more important than ever to have some methods behind the madness. Adhering to some SOLID OO principles to help keep code clean, maintainable and most importantly; separated from the functions of the user interface. The most important of these SOLID principles in this case is the separation of concerns. By keeping the actions of the UI separate from the logic behind it we allow portability. A lift and shift exercise can be reduced from a back breaking week to a nice easy afternoon. Great,…

Javascript custom event handling in IE

Events can be extremely useful in Javascript, and most browsers implement them naively. Here is an example of an event that fires when the number of vehicles change. This will work on every single browser, except IE. It even works on edge.  If you run this in IE 11 or lower you will receive an “Object does not support this action error”.  To get around this there are two options. JQuery or using a polyfill. For simplicity, cross browser support and the general pervasiveness of JQuery, the first approach is generally the best approach.  You can implement the equivalent above…

Coding standards in Javascript

This is more of a plea than a post, but I would like to impress upon you something important. When it comes to Javascript, please do not throw everything you know about good OO practice out the window! Javascript has gained a bit of a reputation for being misused. It is almost understandable, as it is so easy to do things that you know you really shouldn’t. Oh look, a shortcut! Bad idea. When you come back to try and untangle this shortcut later, you end up with a patchwork of dependencies. The whole thing becomes a nightmare. Once you…