简体   繁体   中英

The buttons won't change the text color or the image size. I think my javascript isn't linked correctly?

This is a section on debugging for prework to a code school. I cannot get the buttons to work at all. I don't have much experience but I think my javascript isn't linked correctly. The javascript file is logic.js and the css file is style.css and I've made sure they are in the same folder.

<!DOCTYPE html>
<html>
<head>
  <title>Boo The Dog</title>
  <!-- Latest compiled and minified CSS -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  <!-- Linking CSS -->
  <link rel="stylesheet" type="text/css" href="style.css">
  <!-- Linking jQuery -->
  <script type="text/javascript" src="logic.js" ></script>

</head>
<body>

this is also at the bottom of the code

<script type="text/javascript" src="logic.js"></script>

尝试使用src="./logic.js"这将强制在同一文件夹中进行搜索。此外,我建议您使用属性defer ,以确保代码在主体之后执行,以避免将标记置于meta之外。

In your code, you have two script links. Can you provide your directory structure?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM