Thanks to all of you who replied. I really forgot this $(function(){ ... });
thing.
Regards,
Johannes
--
View this message in context:
http://www.nabble.com/Beginner-needs-help---Basics-tf3080171.html#a8558442
Sent from the JQuery mailing list archive at Nabble.com.
__
Johannes Theile wrote:
> Hi,
> I came across jQuery, I thinks I might like it, but I'm unable to try it
> out.
>
> I downloaded the uncompressed version and just c&p one of the examples from
> the Wiki. But nothing happens. I tried it with various browsers on two
> systems, but nothing works. So I
Try this:
$(document).ready(function(){
$("a").click(function(){
alert("Thanks for visiting!");
});
});
2007/1/24, Clodelio C. Delfino <[EMAIL PROTECTED]>:
> can't find in your code where "a" is attached to... c",)
>
> On 1/24/07, Johannes Theile <[EMAIL PROTECTED]> wro
An easy mistake to make. Code in the head runs before the rest of the
document is loaded. That means that when you do $("a") there isn't actually
any A's in the document yet.
To ensure that your code only runs when the document is ready, put it in
this structure:
$(function() {
...
});
jQuery
can't find in your code where "a" is attached to... c",)
On 1/24/07, Johannes Theile <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I came across jQuery, I thinks I might like it, but I'm unable to try it
> out.
>
> I downloaded the uncompressed version and just c&p one of the examples from
> the Wiki. But
Hi,
I came across jQuery, I thinks I might like it, but I'm unable to try it
out.
I downloaded the uncompressed version and just c&p one of the examples from
the Wiki. But nothing happens. I tried it with various browsers on two
systems, but nothing works. So I thinks that I'm doing a general mis