Jquery beginner:Help please?

Im brand new to Javascript and Jquery. BRAND new. Ive been through this basic tutorial and downloaded the latest version of Jquery (jquery-1.10.2.js), Im not getting a dialogue window on launch from a basic HTML window. I hope Im pointing correctly to the .js file in my directory.

The tutorial link if needed is http://learn.jquery.com/about-jquery/how-jquery-works/

Can anyone please tell me what Im doing wrong? Many thanks for any contributions.

Code below:

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Demo</title>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
<script src="jquery-1.10.2.js"></script>
<script>
// Your code goes here.
</script>
</body>
</html>

You should have some code where it says:

// Your code goes here.

Sorry, I pasted the wrong version as my example. This is where Im at…still no message on screen.

<!doctype html>
<html>
<head>

&lt;script type="text/javascript" src"../jquery-1.3.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$ ("document") .ready (function () {
	alert ("the page just loaded!");
});
&lt;/script&gt;

</head>
<body>
<h1 id=“hello-world”>Hello World</h1>

</body>
</html>

Hi RaveyDavey,

If you’re new to JavaScript then jQuery isn’t a good starting point as you need a good knowledge of writing vanilla JS before using a library such as jQuery, there are lots of great places to learn JavaScript such as the following.

https://learnable.com/courses/javascript-programming-for-the-web-40

Once you’ve got a good understanding of writing vanilla JS code then you can move onto using more advanced libraries such as jQuery.

https://learnable.com/courses/jquery-fundamentals-1132
https://learnable.com/books/jquery-novice-to-ninja
https://learnable.com/books/jquery-novice-to-ninja-new-kicks-and-tricks

Thanks so much…I appreciate the pointers.

Hi,

First off, I agree with what Chris said in post #4.
However, to address your problem here, I would check your path to jQuery, as the code you provided is otherwise fine.

A couple of tips.

If you put your scripts just before the closing body tag, you almost never have to test if the DOM is ready, because it is by definition:

<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="utf-8">
    <title>Test</title>
  </head>
  
  <body>
    <h1 id="hello-world">Hello World</h1>
    
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script type="text/javascript">
      alert("the page just loaded!");
    </script>
  </body>
</html>

If you aren’t doing anything with jQuery, you don’t need to include it:

<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="utf-8">
    <title>Test</title>
  </head>
  
  <body>
    <h1 id="hello-world">Hello World</h1>
    
    <script type="text/javascript">
      alert("the page just loaded!");
    </script>
  </body>
</html>

Don’t get put off if this all seems a bit daunting. Everyone has to start somewhere.
Feel free to let us know if you have any more questions.