I was reading all similar questions and answers around, but none seem to work for me.
i have this:
<script>
var MyCity = "<?php echo 'Cityville';?>";
</script>
but this outputs the entire php. I also tried this:
<?php echo json_encode('City'); ?>
all these in a WP widget.
any ideas?
thank you!