该按钮不是调用javascript函数

And*_*cci 0 javascript html5 alert function button

我有一个按钮,我想在点击它时调用一个函数.现在它只是测试.就在我现在运行它时,按钮似乎无法点击开始.

index.html的:

<!DOCTYPE html>
<html>
  <head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="css/stylesheet.css"/>
    <script type="text/javascript" src="javascript/javascript.js"></script>
  </head>
  <body>
    <h1>
      <img src="#" alt=""/>
    </h1>

    <h3>1. Getting Store categories</h3>
    <button  onclick="getCategories()">Click here to Get Categories.</button> 
    <p></p>

  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

javascript.js:

function getcategories()
{
    alert("TEST");
}
Run Code Online (Sandbox Code Playgroud)

EDDIT:stylesheet.css:

* {
    font-family: Ariel, Verdana, sans-serif;
}

h1 {
    text-align: center;
    color: #fff;
    text-shadow: 0px 1px 0px #999, 0px 2px 0px #888, 0px 3px 0px #777, 0px 4px 0px #666, 0px 5px 0px #555, 0px 6px 0px #444, 0px 7px 0px #333, 0px 8px 7px #001135;
    font: 80px 'ChunkFiveRegular';
}

img {
    position: absolute;
    top: 0; bottom:0; left: 0; right:0;
    margin: auto;
}

body  {
    background-color: #cccccc;
}
Run Code Online (Sandbox Code Playgroud)

Mik*_*uck 6

在你写的HTML中

getCategories
Run Code Online (Sandbox Code Playgroud)

但在你写的JS中

getcategories
Run Code Online (Sandbox Code Playgroud)

确保这些匹配.将来,打开您的开发工具(点击F12)并查看控制台.它会显示一条错误,说你正在调用一个未定义的函数.