I am calling the javascript function from another file in href, I want to know if there is any way to call it in php without using href?
call from href
<script language="javascript" type="text/javascript" src="js/myjs.js"></script> <a href="javascript:NewCal()">Link1</a> how can I use "javascript:NewCal()" in PHP echo?
echo "<script>NewCal();</script>";. If you want to do this after page load, however, you'll want to look into Ajax.