簡體   English   中英

.js腳本沒有響應

[英].js script not responding

所有這些都是新手,並嘗試讓我的.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>

您尚未包含Jquery庫,請包含一個。

例如: http : //ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js

您必須包括jQuery庫。 您可以為此使用Google CDN

<!DOCTYPE html>
<html>
    <head>
        <title>Button Magic</title>
        <link rel='stylesheet' type='text/css' href='stylesheet.css' />
        <script type= 'text/javascript' src='http://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>
</html>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM