passing parameters to javacsript using php
- by ayush
i have the following line of code -
<a href="javascript:;" onClick="tweeet('myid')">My Tweets!</a>
Now while this is working perfectly fine the following line is not -
<a href="javascript:;" onClick="tweeet(<?php echo 'myid'; ?>)">My Tweets!</a>
Can anyone help me out why it is not working and suggest any changes.
The variable i want to pass to the javascript function is a php variable.
also i have tried the php with single quotes and double quotes but it is not working.