call function from external js (php) file
- by bah
Hi,
I have a file where I keep all scripts so my pages wouldn't get messy (I have php file which generates required javascript).
My includes basically look like this:
</html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="script.php"></script>
</head>
<body>
<input type="button" onClick="return blah();" />
</body>
</html>
In script.php there's jquery wrapper $(document).ready where I keep all jquery related stuff. The funny thing is, when I put function blah() inside this wrapper I get "blah is not defined" error, but when I put it outside - works perfectly. So, what could be the problem?