You are dynamically generating javascript. You will get rid of headaches, if you need it, make it simple. Transfer data from PHP to Javascript in the easiest way at the top of the page:
<script type="text/javascript" > var $current = '<%? echo $current; %>'; </script>
As others have pointed out, you will need to encode and quote your php variable using json_encode (in this case you probably don't need quotes) or a simpler shutdown function if you know the possible values.
Now your inline code might be simpler:
<a href="javascript:wait1();getPass($current);">Comment</a>
A final recommendation would be to output this to your own function and use the onclick attribute.
source share