Woocommerce Checkout JS events $( document.body ).trigger( ‘init_checkout’ ); $( document.body ).trigger( ‘payment_method_selected’ ); $( document.body ).trigger( ‘update_checkout’ ); $( document.body ).trigger( ‘updated_checkout’ ); $( document.body ).trigger( ‘checkout_error’ ); $( document.body ).trigger( ‘applied_coupon_in_checkout’ ); $( document.body ).trigger( ‘removed_coupon_in_checkout’ ); Woocommerce cart page JS events $( document.body ).trigger( ‘wc_cart_emptied’ ); $( document.body ).trigger( ‘update_checkout’ ); $( […]
var json = canvas.toJSON(); canvas.clear(); canvas.loadFromJSON(json, canvas.renderAll.bind(canvas));
canvas.setWidth( <desired width> ); canvas.setHeight( <desired height> ); canvas.calcOffset();
var arrayVar = [ { name: ‘Bobby’, someValue: 123123 }, { name: ‘Phillip’, someValue: 123 } ]; arrayVar = arrayVar.sort((a, b) => {return a.someValue – b.someValue}); // save the sort result // (a – b) = Ascending sort, (b – a) = Descending sort console.log(arrayVar);
var grammar = ‘#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | […]
var somePageElement = ‘{ “name”:”John”, “age”:30, “car”:”Tesla” }’; var jsonString = ‘[‘ + somePageElement.split(‘[‘)[1].somePageElement(‘]’)[0] + ‘]’;
function WelcomeMSG () { alert(“The river will start flowing soon. Please bear with us while we are under construction.”) }