2015-05-15 38 views
3

为什么它不会淡出?为什么它不淡出?

<!DOCTYPE html> 
<html> 
    <head> 
    <link rel="stylesheet" type="text/css" href="stylesheet.css"/> 
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js"></script> 
    <script type="text/javascript" src="script.js"></script> 
    </head> 
    <body> 
     <p>asdasds</p> 
    </body> 
</html> 

我的script.js是一个外部文件

$(document).ready(function() { 
    $('p').fadeOut(500); 
}); 
+0

哇有趣个个都是精品中的代码 –

+0

https://jsfiddle.net/somnath_k/no7jydaw/代码没有错..你有什么错误吗? –

+1

网址http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js不存在。 – panther

回答

4

错误404当我在你的脚本标签打开新的标签页下面的代码

http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js

使用。

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script> 

或按kmsdev建议添加最新版本

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> 
+0

我应该使用什么库? –

+4

或使用新的2.x版本...'https:// ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' – kosmos

+0

它的工作原理!谢谢 。 。 。 –