tags:

views:

34

answers:

1

Hi,

Kinda New to Jquery and hit an issue regarding returned HTML. I am using the .load() function to load HTML returned from a jsp file - its all working grand except the returned HTML doesnt seem to allow further Jquery functions to be called on it.

i have a click and toggle combination running for "#showgame" - this id is in the returned HTML but clicking on it does nothing when it should. Do i have to update anything to tell jquery that this id now exists on the page after load() call?

Regards,

Cormac

+1  A: 

You need to use the live() function to bind the click event.

$("#myelement").live("click", function() { });

Live binds the event to current and future elements that match the selector.

Read more at http://api.jquery.com/live .

Joel Potter
Hi Joel, Thanks!!! Works a treat
Cormac O'Donnell