Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1159 closed bug (worksforme)

It just doesn't work

Reported by: whocares Owned by:
Priority: undecided Milestone: 1.1.3
Component: ajax Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:

Description

Downloaded compress and uncompressed version. Tried the first step of the tutorial with both FireFox and IE 6.0, and nothing happened.

Here's the code:

<html> <head>

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

$("a").click(function(){

alert("Thanks for visiting!");

});

</script>

</head> <body>

<a href="http://jquery.com/">jQuery</a>

</body> </html>

Change History (2)

comment:1 Changed 13 years ago by aheimlich

Try this:

$(document).ready(function() {

$("a").click(function(){

alert("Thanks for visiting!");

});

});

See http://docs.jquery.com/Tutorials:Introducing_%24%28document%29.ready%28%29

comment:2 Changed 13 years ago by john

Resolution: worksforme
Status: newclosed

Correct - be sure to use document ready.

Note: See TracTickets for help on using tickets.