A php include
(a form submission) prints this when the form inputs were valid.
if ( $valid ) {
echo "<script type='text/javascript'>
$(document).ready(function() {
console.log('success');
notificationOutput('success', 'Successfully subscribed');
});
</script>";
In my header.php
I'm including jQuery.
However when doing the thing above my console tells me that it doesn't know $
. It doesn't make a difference if I write jQuery(document).ready(…
What do I miss here? As said above the echo
is inside an included file so the header with all its scripts is already on the page.
Thank you in advance.