Forum Moderators: open
<script src="http://localhost/Databases/webpages/Hi.php">
</script><form action="Hi.php">
<input type="button" value="Hi" onclick="Hi();" />
</form>
Hi.js
<script type="text/javascript" language="javascript">
function Hi()
{
alert("hi");
}
</script>
Can someone explain why this is not working and a possible solution?
rdunne
Why are you calling a PHP script in your JS include line?
The PHP script (server-side) may output JavaScript and if PHP is sending the correct header, a standard JS file will appear at the browser end. Either that or it's a typo?! ;)