Programming

Avoid Expensive innerHTML Manipulation with insertAdjacentHTML

Posted on

It is pretty well known these days that fiddling with innerHTML is terribly inefficient. It triggers serialization, and it can result in invalid markup. Nevertheless, you’ll still find this being done in many applications. elem.innerHTML = elem.innerHTML + ‘<a href=”https://www.example.com”>Visit Example Dot Com</a>’; // or elem.innerHTML += ‘<a href=”https://www.example.com”>Visit Example Dot Com</a>’; You can avoid […]

Programming

Set a Minimum Font Size

Posted on

This is just a little script I needed to use to increase text size conditionally. It only increases text below a minimum size and leaves everything else. (function () { var minFontSize = function () { $(“.content-zone *”).each(function () { var $this = $(this); if (parseInt($this.css(“fontSize”), 10) < 16) { $this.css({ “font-size”: “16px” }); } […]

Automation

Manipulating Variables in JMeter

Posted on

There are many reasons for manipulating variables in JMeter, especially when you are loading data from a CSV data set config element. You might want to trim a JMeter variable, or grab just a substring. In all of these cases, your existing knowledge of JavaScript can come to the rescue. Wherever you were about to […]

Analytics

Debugging Adobe Analytics

Posted on

Adobe Analytics can sometimes be a bit of an enigma, so people often turn to browser extensions to help them with debugging Adobe Analytics. However, for those of us who spend most of our lives in browser tools; there’s a simple way to get x-ray vision into what Analytics is thinking. Let’s get straight down […]

Programming

Find All Images on a Page With JavaScript

Posted on

One of the most common issues I see in content-managed websites is the presence of a fully-qualified image address that isn’t secure when the website itself is. When this happens, you’ll need to find all images that aren’t secure and fix them. For example, if you are visiting https://www.example.com and there is an image http://www.example.com/image.png […]

Programming

Minification Failed. Returning Unminified Contents.

Posted on

Has you ASP.NET applicaiton reported that minification failed? If you are using bundles in application, you might come across this exception comment at the top of your larger-than-expected bundle file. /* Minification failed. Returning unminified contents. (List of problems here) */ It can happen for JavaScript or CSS, but it means minifier has found something […]