I need to run a script after a hook is fired in my functions.php file. Im using a wordpress mailchimp plugin, I need to do some text inserts and
, etc, in the html:
The error I got was
is
. I assume the document is not ready?
does not work. <strong>Am I doing this wrong?</strong> I need to run that code after that hook is called. Putting the code in
file works great. Thanks
Code:
display = "none"
Code:
add_action( 'mc4wp_form_success', function() {
// do something
echo '<script type="text/javascript">',
'console.log("starting....");', // this works
'document.getElementById("mailchimp-is-subscribed").style.display = "none";',
'document.getElementById("mailchimp-success-form").style.display = "block";',
'console.log("end");',
'</script>';
});
The error I got was
Code:
style
Code:
null
Code:
$
Code:
.js