混合PHP Echo和Javascript [关闭]

Strange question i have

echo "<tr><td onmouseover="xmlhttpPost('obrada.php', 'prva', 'osx-modal-data'); return false;">
<a href='#' class='osx'>".$row->COUNTRY."</a></td>";

The problem is in ' in function Javascript i have to have ' and " when i write this kind of exit that is just in normal HTML all is doing nice, but when i use this on exit in PHP i got error?? The problem is when i change

"xmlhttpPost('obrada.php', 'prva', 'osx-modal-data'); return false;"

to

'xmlhttpPost('obrada.php', 'prva', 'osx-modal-data'); return false;'

the function is not working?? I dont know why?

Txanks in advance on answer

 echo "<tr><td onmouseover=\"xmlhttpPost('obrada.php', 'prva', 'osx-modal-data'); return false;\"><a href='#' class='osx'>".$row->COUNTRY."</a></td>";

add slashes inside your js: 'xmlhttpPost(\'obrada.php\', \'prva\', \'osx-modal-data\'); return false;'

You need to escape your quotes. Escaping tells PHP to not consider those quotes as part of the processed code. It still process normally for Javascript though.

 echo "<tr><td onmouseover=\"xmlhttpPost('obrada.php', 'prva', 'osx-modal-data'); return false;\"><a href='#' class='osx'>\".$row->COUNTRY.\"</a></td>";

Escaping allows you to use whichever quotes you prefer/need.