laipower/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Generic_WidgetBoldGrid_View.js

28 lines
625 B
JavaScript
Raw Normal View History

2024-03-28 09:40:10 +00:00
jQuery( document ).ready( function( $ ) {
$( window ).on( 'message', function( event ) {
var originalEvent = event.originalEvent,
expectedOrigin = document.location.protocol + '//' + document.location.hostname,
message;
if ( originalEvent.origin !== expectedOrigin ) {
return;
}
if ( originalEvent.data ) {
try {
message = $.parseJSON( originalEvent.data );
} catch ( e ) {
return;
}
}
if ( ! message || 'undefined' === typeof message.action ) {
return;
}
if (message.action == 'install-plugin') {
window.location = $('#w3tc-boldgrid-install').prop('href');
}
});
});