jQuery and Javascript

Delaying or pausing the execution of a jQuery .each() loop

By Chris Aram / April 14, 2019 / 0 Comments

Recently, I wrote a scraper app which fetches a series of pages, pulls all of the <img /> tags into a list and then downloads them to the user’s computer. (Back story: we often work with clients who want to transfer their website away from a closed-source provider like Squarespace. These providers often do not…

Read More

Bind select2 to dynamically generated elements

By Chris Aram / March 31, 2019 / 0 Comments

In the course of our WordPress development, we often generate new <select> elements on the fly, after the DOM has been loaded jQuery’s document ready() has already run. Most tutorials demonstrate binding <select> with something like this: jQuery( function() { jQuery( “select.select2” ).select2({ // any options go here }); }); The challenge is that this…

Read More