0

I have tried everything to get the following code working but I cant seem to load jquery properly. I have tried installing from a folder with in the project and from using a URL.

Here is my snippet of code which includes the different methods I had being using in order to load the JQuery Library.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="" content="">
<title>DynamicPulldown</title>

<!-- <script id="javascript" src="http://localhost:81/js/jquery-
3.2.1.min.js"></script>-->
<!-- <script id="javascript" src="http://localhost:81/js/jquery-
3.2.1.min.js"></script>-->

<script src="/js/jquery-3.2.1.min.js"></script>

 <script>
    $(document).ready(function(){
        $("p").click(function(){
            $(this).hide();
        });
 </script>

  </head>
   <body>
   <div>
  <p>If you click on me, I will disappear.</p>
  <p>Click me away!</p>
  <p>Click me too!</p>

 </div>
</body>
</html>

I have placed my index.html file in the following folder C:\xampp\htdocs and the jquery-3.2.1.min.js file in the following folder C:\xampp\htdocs\js

My url to view the page in my browser is http://localhost:81/index.html.

Thank you

Dave

3
  • please see console and check for error !! Commented Apr 14, 2017 at 10:41
  • there are no errors related to jquery in the error logs Commented Apr 14, 2017 at 10:46
  • last mention of jquery ::1 - - [14/Apr/2017:11:44:17 +0100] "GET /jquery-3.2.1.min.js HTTP/1.1" 304 - "localhost:81/index.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" Commented Apr 14, 2017 at 10:52

3 Answers 3

1

Replace this code

<script>
    $(document).ready(function(){
        $("p").click(function(){
            $(this).hide();
        });  
     });
 </script>
Sign up to request clarification or add additional context in comments.

1 Comment

Working now. Thank you very much all
0
 Please add this )} at  the end of the code.
 $(document).ready(function(){
    $("p").click(function(){
        $(this).hide();
    )};
    });

Comments

0

You forgot 2 brackets! Do }) at the end!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.