Im getting an error that there is a syntax problem on the line where selection = ui.item.addClass etc.. , but I can't figure out what it is. I think I have escaped all the right quotes but I'm not sure. note: the first two variables are meant to contain empty single quotes.
<?php
echo "<script>";
echo "$(function(){";
echo "var selection = \' \'; ";
echo "var selectClass = \' \'; ";
echo " $(\".menu\").menu({ ";
echo " select: function (event, ui) { "
echo " $(\'.selected\', this).removeClass(\'selected\'); ";
echo " selection = ui.item.addClass(\'selected\').children(\'a\').attr(\'name\');";
echo " }"; // closes select function
echo " }); "; // closes menu
echo " </script>";
?>
echo ;? Why don't you just drop out of your PHP tags then drop back in?'within a"- a plain 'select' would work