$( "#wiki_content a" ).live('click', function(event) {
event.preventDefault();
var link = $(this).text();
searchDelay( link );
});
--Karl
____________
Karl Swedberg
On Feb 28, 2009, at 11:35 AM, hybris77 wrote:
thanks for the feedback, that is a much better solution, however
I don't seem to be getting hold of the <a> tags that im after, the
problem might be the fact that the div containing the tags is not yet
populated when the jquery function to get them runs... but im not sure
the div #wiki_content is populated using a AJAX call just before
the code im posting here, it contains a set of <p> tags with <a>
tags in them but pointing at the div itself will get hold of the
a tags right?
On 28 Feb, 17:27, Karl Swedberg <k...@englishrules.com> wrote:I think it would be a lot simpler to rely on jQuery's implicititeration:$( "#wiki_content a" ).click(function(event) {event.preventDefault();var link = $(this).text();searchDelay( link );});--Karl____________Karl Swedbergwww.englishrules.comwww.learningjquery.comOn Feb 28, 2009, at 10:50 AM, hybris77 wrote:can anyone please see waht's wrong with thisI want to get all <a> tags in the div #wiki_content and get the textfromit and send into a function called searchDelay... im not getting asfar asjumping into the $.each loop so not sure waht's wrongvar links = $( "#wiki_content a" );$.each( links, function( event ){$(this).click(function( event ){event.preventDefault();var link = $(this).text();searchDelay( link );});});many thanks
No comments:
Post a Comment