| 1 |
try { |
| 2 |
var ev = (typeof CustomEvent === 'function') ? new CustomEvent( 'wpbc-ready' ) : document.createEvent( 'Event' ); |
| 3 |
if ( ev.initEvent ) { |
| 4 |
ev.initEvent( 'wpbc-ready', true, true ); |
| 5 |
} |
| 6 |
document.dispatchEvent( ev ); |
| 7 |
console.log( 'wpbc-ready' ); |
| 8 |
} catch ( e ) { |
| 9 |
console.error( "WPBC event 'wpbc-ready' failed!", e ); |
| 10 |
} |
| 11 |
|