this is my first post, i'm new to jquery and have always been a cut and paste
JS guy ... relying more on php to take care of my needs. i found jquery and
i'm in love with it ... who that's tried it isn't?

anyways ... i have a problem that will probably annoy several of you as it's
all over the board.

note, i actually bought "learning jquery" to assist me with this, but 

"AJAX and Events
Suppose we wanted to highlight all the <h3> elements on the page when they
are
clicked. By now the code to perform such a task is almost second-nature:
$(document).ready(function() { .... "

... just isn't helping me, yes , i'm that noob.

ok, so i use the the form plugin function to load in some search results
from my database, i load this data into a div on my page ...

(i removed the angle brackets as they turned to links in my post)

a href="partSearch2.php?pn=AS1004S" class="partresult" >AS1004S
a href="partSearch2.php?pn=AS1104M01" class="partresult" >AS1104M01
a href="partSearch2.php?pn=AS1581T" class="partresult" >AS1581T
a href="partSearch2.php?pn=AS1582T" class="partresult" >AS1582T


with these results, i want to load the above hrefs into another div on my
page, so i wrote this ...

$(document).ready(function() {

$('body').click(function(event) {

if ($(event.target).is('.partresult')) {

var resultlink = this.href;
alert (resultlink); // added to see it it captures the href
$("#loadmehere").load(resultlink);
return false;

}

});
});

but it's not grabbing the href ... it comes up undefined. i'm lost, this
seems simple but i've spent 2 days fighting with this ... any help would be
greatly appreciated.

not sure if this is it, but is this event bubbling and where it's trying to
grab the href it's actually trying to grab an href from the bidy tag? how do
i zero in on the clicked element.

i'm losing it!

thanks for your help and gentleness to a JS noobie. :)




-- 
View this message in context: 
http://www.nabble.com/please-prevent-a-nervous-breakdown-...-i%27m-just-not-understanding-event-bubbling-and-attaching-events-to-the-dom-tf4074714s15494.html#a11580314
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to