I am echoing a javascript block using PHP like this...
echo "<script language='javascript' type='text/javascript'>
jQuery(document).ready(function($){
var $lg = $('#mydiv');
});
";
But I am getting the following error message...
Notice: Undefined variable: lg
When I inspect the source, the line that defines $lg looks like this...
var = $('#mydiv');
Any ideas why it is happening? Does the $ need escaping?