jQuery / Javascript Posts

jQuery / Javascript

How do I properly use .map(), .filter() and .find() in ECMAScript 2015+?

Loren Wright • March 26, 2018

Back in 2015, ES5 introduced .map(), .filter() and .find() methods for iterating over arrays. Yay! Cue confetti cannon. Programming has never been so easy! That all sounds great, but what does it mean? This means that you can now iterate over an…

Read More

jQuery / Javascript

How do I pass data from component to component in react.js?

Mitch Peterson • March 6, 2018

React.js is a wonderful javascript framework built by engineers at Facebook. It’s great for building fast, scalable and modular applications. While it might seem a bit scary at first, it’s actually pretty easy to use …once…

Read More

API

Can Instagram posts be easily retrieved?

Mike Wang • February 8, 2018

Edit – 29 Mar 2018 – In the time between when this article was posted and now, Instagram updated this API. The map() example has been updated to reflect this.   Edit – 22 Apr 2018…

Read More

jQuery / Javascript

How do I develop a countdown timer?

Darren Hagen • January 2, 2018

So i’m getting married this year…I know, congratulations. Well, during the development of my wedding website I decided that I wanted to create a countdown timer that would capture the days, hours, minutes, and seconds until…

Read More

API

How can i stop my AJAX call so I can start a new one?

Sarah Berg • December 26, 2017

The use case for this was a search functionality that was triggered on keyup.  That said, the more a user typed the ajax call would fire again and again till the search had queued so many…

Read More

jQuery / Javascript

How Do I Prepopulate a Form Field Based On Previous Page Input?

Ashley Wright • December 13, 2017

In this scenario, say you have a newsletter signup form on your homepage with one single email field to fill out. On submit of this field you would like the user to be sent to a new…

Read More

jQuery / Javascript

Can strings be compared fuzzily?

Mike Wang • November 20, 2017

It’s Thanksgiving week and you’re putting the finishing touches on your new e-commerce site, just in time for Black Friday. You’ve just gotten the product search functionality working, so you kick back in your chair and…

Read More

jQuery / Javascript

How do I update the URL on button click?

Biz Cook • November 14, 2017

Do you have AJAX on a page and want to change the URL accordingly based on the new content? The following code will get rid of the last bit of the slug on your page and…

Read More

jQuery / Javascript

How do I place SVGs on a Google Map using Custom Overlays?

Loren Wright • October 31, 2017

The Google Map API is very robust and allows you to do almost any customizations that you need to do to a map. One of the features that Google has created is Custom Overlays. A custom…

Read More

jQuery / Javascript

How do I make numbers ‘roll up’ when counting?

Darren Hagen • October 23, 2017

During a project recently we were tasked with demonstrating a number counting up in the way of rolling. A good way to describe the action is how you would see an old gas pump price or…

Read More

jQuery / Javascript

Can I Make Google Maps Match the Color Scheme of My Site?

Brent Reno • September 8, 2017

It’s great having google maps embedded on a site, but sometimes the default color scheme just doesn’t look great with everything else going on. For the purpose of this, let’s assume the API key is already…

Read More

jQuery / Javascript

Uncaught TypeError: .sort is not a function ?!

Sarah Berg • August 16, 2017

So i’ve done some ajax calls and wanted to sort my results and ran into the error: Uncaught TypeError: resultData.sort is not a function This is because the returned data is an object and jQuery’s sort…

Read More

jQuery / Javascript

Are there vanilla alternatives to jQuery?

Mike Wang • June 30, 2017

jQuery definitely has its shining moments. After all, there must be a reason for its enormous popularity. However, there are also many situations where the use of jQuery adds HTTP requests and data to transfer without enough…

Read More

jQuery / Javascript

Is There a JS Library for Generating a PDF?

Brent Reno • June 27, 2017

jsPDF is a Javascript library used to generate  PDF files, that can be downloaded, printed or emailed. Getting Started: To star declare a new instance of jsPDF. var doc= new jsPdf(); You can pass parameters in…

Read More

jQuery / Javascript

Can the Wysiwyg in WordPress have a custom Color Swatch Library?

Biz Cook • June 12, 2017

The pre-determined color swatch options in a wysiwyg are colors that usually clash with the overall branding of the website. To encourage the content editor to use colors that coincide with the branding identity of an…

Read More