kollapsminoriteten/wp-content/plugins/jetpack/_inc/crowdsignal-shortcode.js

21 lines
649 B
JavaScript
Raw Permalink Normal View History

2023-04-26 17:39:43 +02:00
( function ( w, d, c, j ) {
2019-11-15 23:26:29 +01:00
if (
2023-04-26 17:39:43 +02:00
w.crowdsignal_shortcode_options &&
w.crowdsignal_shortcode_options.script_url &&
2019-11-15 23:26:29 +01:00
! d.getElementById( j )
) {
var pd = d.createElement( c ),
s;
pd.id = j;
pd.async = true;
2023-04-26 17:39:43 +02:00
pd.src = w.crowdsignal_shortcode_options.script_url;
2019-11-15 23:26:29 +01:00
s = d.getElementsByTagName( c )[ 0 ];
s.parentNode.insertBefore( pd, s );
2025-02-28 08:42:11 +01:00
} else if ( typeof w.jQuery !== 'undefined' ) {
2023-04-26 17:39:43 +02:00
// In environments where jQuery is present, dispatch with jQuery.
2025-02-28 08:42:11 +01:00
w.jQuery( d.body ).trigger( 'pd-script-load' );
} else {
d.body.dispatchEvent( new Event( 'pd-script-load' ) );
2019-11-15 23:26:29 +01:00
}
2023-04-26 17:39:43 +02:00
} )( window, document, 'script', 'pd-polldaddy-loader' );