Problem: The script listed below will only run if it's listed out on the page. If its enqueued then it fails. I assume this is because if its enqueued then the php is NOT processed, but I don't know enough to be sure.
Question Is there any way to call the script or is it just a fundamental requirement that any script containing php has to be listed on the page?
Thanks
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#buttonLink').dialog({autoOpen: false});
var readerStatus="<?php echo $_COOKIE['readerStatus'];?>";
if (readerStatus=="tester")
{
jQuery("#buttonLink").dialog('open');
}
});
</script>