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

Set timeout for ajax (jQuery)

Please read the $.ajax documentation, this is a covered topic. You can get see what type of error was thrown by accessing the textStatus parameter of the error: function(jqXHR, textStatus, errorThrown) option. The options are “timeout”, “error”, “abort”, and “parsererror”.

MRAID file reference

The IAB MRAID specification http://www.iab.net/media/file/IAB_MRAID_VersionOne_final.pdf Says that a reference to an mraid.js file should be the first line within an MRAID compliant ad MRAID script referenceThe MRAID comment follows HTML Javascript syntax so that both fully formed web pages and HTML fragments can be identified as MRAID ads. <script src=”mraid.js”></script> Which is ok. But I am being … Read more