Hi,
I have a php function creating links from a products mysql database.
some of the descriptions have characters that I need to escape but
whatever i do, javascript doesn't like them.
for example a product description might be
30' black ribbon
I have tried backslash escapes and a php function, htmlspecialchar s
http://us3.php.net/htmlspecialchars
how should I escape the parameters?
Any help is appreciated,
Chuck
here is a basic example of what i am trying to do without success.
<script type="text/javascript">
function showValue(val)
{ document.getEle mentById('show' ).innerHTML = val;
return false;
}
</script>
<p><a href="#" onclick="return showValue('aaa' );">aaa</a></p>
<p><a href="#" onclick="return showValue('64"' );">64"</a></p>
<p><a href="#" onclick="return showValue('34\" ');">34"</a></p>
<p><a href="#" onclick="return showValue('< a
href='test'> Test</a>');">< ;a
href='test'> Test</a></a></p>
<div id="show"></div>