javaScript Tips

EXAMPLE OF PROMISE.ALL()

Example of Promise.all() Do you need to iterate over an array of promises? Promise.all() is often the best way. Promise.all(iterable) returns a single promise. Promise.all(iterable) only resolves after every promise in an array of promises has completed resolving. Since the elements of the array are promises, they do not resolve in any particular order. If… Read more EXAMPLE OF PROMISE.ALL()

Inject jQuery into a Webpage Through Chrome Javascript Console

include these lines of jQuery instantiation code in the javascript console Exploring the DOM is much easier with jQuery. However, You may be working with a webpage that does not natively have jQuery installed. That’s ok, the following lines of code will solve this. Just include these lines of jQuery instantiation code before you explore… Read more Inject jQuery into a Webpage Through Chrome Javascript Console

Iterate an array with a promise in javascript

Example of how to iterate an array with a promise It can be challenging to figure out how to iterate over an array of items with a promise. The following code takes a callback function that may or may not be a promise already. Once inside the PromiseForEach function, the callback will become a promise… Read more Iterate an array with a promise in javascript

[SOLVED] How to Fix $.ajax() Not Working ie 8, ie 9 and ie 10

  jQuery is an great tool to use for making ajax calls. As usual MS Internet Explorer has to make things that would otherwise be standard — difficult. Setting aside any rants about how much hair one can pull out in the days it takes to accomplish something that should have been easy, here is what… Read more [SOLVED] How to Fix $.ajax() Not Working ie 8, ie 9 and ie 10

How to Get All the Selected Values from a Multi-Select with jQuery

Need to know how to get all the selected values or text values from a multi select element (drop down)? Its simple with jQuery! Start by declaring an array. One for the values of the multi select element and one for the text values. Well, if you even need the text values from the multi… Read more How to Get All the Selected Values from a Multi-Select with jQuery

Dynamically Change the onClick, onChange (or other) Value of an Element

If you are implementing AJAX, you will likely run into the need to change the functionality of a button dynamically. There is not a whole lot out there on how to quickly accomplish this so here is a simple explanation. Typically, you have an element such as an “input”, “a” or “select (options)” that has… Read more Dynamically Change the onClick, onChange (or other) Value of an Element