[jQuery] Re: Why I can't access to a tag in a div

2007-06-13 Thread Klaus Hartl
Andy Matthews wrote: Your code is saying an A tag that has an id of response. To get a jQuery object containing all a tags inside that div, it should look like this: #response a That says any A tag inside a container with an id of response. If in doubt what a selector selects, use

[jQuery] Re: Why I can't access to a tag in a div

2007-06-13 Thread Klaus Hartl
Massimiliano Marini wrote: Well, it depends. When you say that the content is generated dynamically, are you saying that it's generated by a server side language like ColdFusion or PHP? I think this case, this is my code: $.ajax({ type: GET, url: news.php, success: function(msg){

[jQuery] Re: Why I can't access to a tag in a div

2007-06-13 Thread Andy Matthews
I did the same thing once and it took me asking the list to get the answer. Now I know, and I'm able to pass it on to you. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Massimiliano Marini Sent: Tuesday, June 12, 2007 5:26 PM To:

[jQuery] Re: Why I can't access to a tag in a div

2007-06-12 Thread Andy Matthews
Your code is saying an A tag that has an id of response. To get a jQuery object containing all a tags inside that div, it should look like this: #response a That says any A tag inside a container with an id of response. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL

[jQuery] Re: Why I can't access to a tag in a div

2007-06-12 Thread Massimiliano Marini
Your code is saying an A tag that has an id of response. To get a jQuery object containing all a tags inside that div, it should look like this: #response a I have corrected as you have said, but still not work, this is the correction I have applied: $(#response a).click(function(){

[jQuery] Re: Why I can't access to a tag in a div

2007-06-12 Thread Andy Matthews
Well, it depends. When you say that the content is generated dynamically, are you saying that it's generated by a server side language like ColdFusion or PHP? Or is it being generated by Javascript? If it's created by javascript, after the page is loaded, then you'll need to reassign the click

[jQuery] Re: Why I can't access to a tag in a div

2007-06-12 Thread Massimiliano Marini
Well, it depends. When you say that the content is generated dynamically, are you saying that it's generated by a server side language like ColdFusion or PHP? I think this case, this is my code: $.ajax({ type: GET, url: news.php, success: function(msg){

[jQuery] Re: Why I can't access to a tag in a div

2007-06-12 Thread Sean Catchpole
You have to rebind the clicks after the ajax loads: $.ajax({ type: GET, url: news.php, success: function(msg){ $(#response).fadeIn(slow).html(msg); $(#response a).click(function(){ alert(Hello); return false; )}; } }); ~Sean

[jQuery] Re: Why I can't access to a tag in a div

2007-06-12 Thread Massimiliano Marini
You have to rebind the clicks after the ajax loads: Thank you 1K Sean for and Andy, I've learned something new -- Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/ It's easier to invent the future than to predict it. -- Alan Kay