I don't get the jQuery to work!
Hello!
Im about to try learning to script in jQuery and .php. I have tried alot of different aproches to solve this one but i think im stuck.
This is the code:
index.php
- <html>
- <head xmlns="http://www.w3.org/1999/xhtml">
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
- <script src="script/jquery.js" type="text/javascript"></script>
- <script src="script/custom.js" type="text/javascript"></script>
- </head>
- <body>
- <!-- we will add our HTML content here -->
- <a href="">Link</a>
- </body>
- </html>
script/custom.js
- jQuery(document).ready(function() {
- $'a'.click(function()
- {
- alert("Hello World!");
- });
- });
The JQuery file is stored in script/jquery.js.
This wont simply work. I have tried to change the url to the site url, switch between / and \, put the js files in the same directory, change the 'a'.click to "a".click.
Im really frustrated and i guess that it's so obvius to you experienced people what im doing wrong.
Im running my site on a IIS 6.0 server.
I hope someone can help me!
Thanks!
//RanGvalD