Skip to content

Instantly share code, notes, and snippets.

View enovision's full-sized avatar
💪
Feeling great!

Enovision IT & Web Services enovision

💪
Feeling great!
View GitHub Profile
@enovision
enovision / ajax.js
Created February 27, 2020 16:54 — forked from franz-josef-kaiser/ajax.js
AJAX in WordPress. Class based example.
( function( $, plugin ) {
"use strict";
// Working with promises to bubble event later than core.
$.when( someObjectWithEvents ).done( function() {
console.log( 'AJAX request done.' );
} )
.then( function() {
setTimeout( function() {
console.log( 'AJAX requests resolved.' );