0

my simple HTML : tesJQUERY.html

<html>
   <head>
     <title>Tes JQuery</title>
     <script type="text/javascript" src="tes.js"></script>
   </head>
   <body>
      <div >
        hahaha
       </div>
   </body>
 </html>

my simple jQuery script : tes.js

 $(document).ready(function() {
    $('div').hide();
});

I have connected them and it was displayed in my dreamweaver..but not working...

1
  • 1
    You haven't loaded jQuery's library Commented Jun 16, 2013 at 11:27

3 Answers 3

2

You need to include jQuery like this (before including your tes.js)

<html> 
<head><title>Tes JQuery</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> 
<script type="text/javascript" src="tes.js"></script> 
</head> 
<body> 
   <div> hahaha </div> 
</body> 
</html>
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, can i just download the file instead using link to the jquery reference ?
@JohanSurya Yes, you can download and use it offline.
1

You need to include external jquery in your html file either by downloading it or using online version like:

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

or

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>

You can download the latest versions of jquery from below URL:

http://code.jquery.com/jquery-1.8.3.min.js (compressed, for production)

http://code.jquery.com/jquery-1.8.3.js (uncompressed, for debugging)

2 Comments

how to download the offline version ?
Please go to the URL to download the latest version of jquery and save them to the file system.
0
<html>
<head>
<title>Tes JQuery</title>
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="tes.js"></script>
</head>
<body>
<div >
    :D :D :D
</div>
</body>
</html>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.