javascript - .js 脚本没有响应

标签 javascript html css coda

所有这些都是新手,并试图让我的 .js 脚本在 Coda2 中工作。如果有人知道为什么 .js 脚本文件没有响应,那就太好了!

提前致谢!

<!DOCTYPE html>
<html>
<head>
    <title>Button Magic</title>
    <link rel='stylesheet' type='text/css' href='stylesheet.css' />
    <script type= 'text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script>
    <script type= 'text/javascript' src='script.js'></script>
</head>
<body>
    <div><br/><strong>Click Me!</strong></div>
</body>

在脚本中:

$(document).ready(function() {
$('div').mouseenter(function() {
    $('div').fadeTo('fast',1);
});
$('div').mouseleave(function(){
    $('div').fadeTo('fast',0.5);
});

});

请在此处找到我的代码的图像:

http://postimg.org/image/qis0sitd1/

最佳答案

您还没有添加脚本标签来包含 jQuery。

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js' type='text/javascript'></script>

关于javascript - .js 脚本没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16032882/

相关文章:

javascript - 使用 JavaScript 检索 bodyOOXML.value 时 OOXML 中缺少 word/numbering.xml

javascript - 我需要将重复单词上的长字符串拆分为数组

jQuery animate 不工作(margin-left -200 到 margin-left +200)

html - 找出某个计算的 CSS 样式的原因

javascript - 当开发人员工具打开 IE11 时,网站的行为有所不同

html - 在 css 中定义类的正确方法

javascript - 当框架从 DOM 中删除时,内部运行的 JS 是否会从内存中清除?

javascript - 为多个图像添加 HTML5 Canvas 黑白效果

javascript - 使用 javascript 将 iframe contenteditable 中的内容绘制到 html5 Canvas 上

javascript - 像桌面应用程序一样调整 div 大小