jubiluk babawakis
jubiluk babawakis

Reputation: 37

Why it doesn't fade out?

Why it doesn't fade out?

<!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>

my script.js is an external file

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

Upvotes: 3

Views: 115

Answers (1)

Sudharsan S
Sudharsan S

Reputation: 15393

Error 404 when i open in new tab

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

Use below code in your script tag.

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

or as per kmsdev suggested add newest version

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

Upvotes: 4

Related Questions