外部javascript无法在服务器端使用PHP处理webmatrix

外部javascript无法在服务器端使用PHP处理webmatrix,javascript,php,Javascript,Php,我刚刚开始使用PHP进行服务器端编程。我正在使用Microsoft Webmatrix进行开发。问题是外部javascript文件无法工作,尽管嵌入式代码工作正常。我曾尝试将文件扩展名从index.html更改为index.php,但没有成功 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Learning PHP</t

我刚刚开始使用PHP进行服务器端编程。我正在使用Microsoft Webmatrix进行开发。问题是外部javascript文件无法工作,尽管嵌入式代码工作正常。我曾尝试将文件扩展名从index.html更改为index.php,但没有成功

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Learning PHP</title>
    <link rel="stylesheet" type="text/css" href="style.css"/>
    <script type="text/javascript" src="script.js"></script>
</head>
<body>
<form action="welcome.php" method="post" name="myForm" target="_blank" onsubmit="">
   <label for="first-name">First Name: </label>
   <input type="text" name="first-name" placeholder="John" id="first-name"/>
   <label for="last-name">Last Name: </label>
   <input type="text" name="last-name" placeholder="Doe" id="last-name"/>
   <input type="submit"/>
   </form>
</body>

学习PHP
名字:
姓氏:

你能从
script.js
添加javascript代码吗?你在用什么浏览器?我在用chrome。几次刷新后,它工作正常。虽然语法正确,但我不知道出了什么问题。但现在已经修好了。