Developing an ad with MRAID.js

I need to develop an ad that’s MRAID compliant. I’ll be hand-coding the ad in HTML5 and not using any authoring software with an MRAID SDK. According to the spec, mraid.js gets injected by the SDK where the ad is hosted. How do I get access to the MRAID functions to test when developing the … Read more

ESLint Parsing error: Unexpected token

Unexpected token errors in ESLint parsing occur due to incompatibility between your development environment and ESLint’s current parsing capabilities with the ongoing changes with JavaScripts ES6~7. Adding the “parserOptions” property to your .eslintrc is no longer enough for particular situations, such as using in ES6 classes as ESLint is currently unable to parse it on … Read more

How to test valid UUID/GUID?

Currently, UUID’s are as specified in RFC4122. An often neglected edge case is the NIL UUID, noted here. The following regex takes this into account and will return a match for a NIL UUID. See below for a UUID which only accepts non-NIL UUIDs. Both of these solutions are for versions 1 to 5 (see the … Read more

querySelector vs. getElementById

I have heard that querySelector and querySelectorAll are new methods to select DOM elements. How do they compare to the older methods, getElementById and getElementsByClassName in terms of performance and browser support? How does the performance compare to using jQuery’s query selector? Is there a best practice recommendation for which method to use?

Escaping Discord subset of markdown

I’m trying to escape the subset of markdown that Discord supports (*, _, `, ~). Characters that are already escaped should not have additional backslashes added. This is what I have:  Run code snippetExpand snippet This works fine, minus the fact that multiple markdown characters against each other will not all be escaped. I’m not sure how to … Read more