when you view source do you see what you expect. If not that's the place to start.
then when that's ok save the source and work with that until you get the expected result.
I would imagine that your function is running straight away when infact you want it to run on page load. In that case try:
<html>
<head>
<script language="JavaScript" src="src.js"></script>
</head>
<body onload="funct('<?=$var?>');">
</body>
</html>
but we need to know where it all goes wrong. Does the script run? Can it find the other info it needs etc....