I am trying to embed some JavaScript into a php page with the intention of getting Jquery to work. The php is in a wordpress site. This will eventually form the basis of a plugin. I have used <script>
tags to embed a call to an alert function, which does work well. Problem is if I try to add some jquery code e.g $(document).ready(function(){});
it doesn't work, any consequent alerts don't work, no errors or anything!
I've tried googling the problem and there's loads of advice but nothing is working
echo "<script>alert('This works')</script>"
echo "<script>
$(document).ready(function(){
alert('But this doesn't');});
</script>"
The first alert appears fine, but the second doesn't.