you dont need to contain them inside of a function like that ( unless you only want to activate them on demand for some reason) , put this in a script block in the head section and give it a try
this will bind the lsiteners as soon as the dom is ready. if you need will be adding and removing elements on the fly, then you will need to go a step further and use .on()
you dont need to contain them inside of a function like that ( unless you only want to activate them on demand for some reason) , put this in a script block in the head section and give it a try
this will bind the lsiteners as soon as the dom is ready. if you need will be adding and removing elements on the fly, then you will need to go a step further and use .on()
Thanks for the help here.
The content on the page is dynamic, it is loaded every time the user clicks the 'next' button, so this needs to run each time that happens.
I tried to simplify this so that only one function is added, in an attempt to get something working here. Still nothing. Does it have something to do with the document not being ready?
I was just messing around with .on() but I get an error telling me that it is not a function. Does that mean that I have an old version of jQuery?
I was just messing around with .on() but I get an error telling me that it is not a function. Does that mean that I have an old version of jQuery?
That could very well be. And it is also easy to find out by looking at the file name of the jQuery file or, if that doesn’t indicate it, right into the jQuery file where the version usually is displayed prominently. You can then compare it with the version number shown on http://jquery.com – and get the latest version right away if applicable.
That could very well be. And it is also easy to find out by looking at the file name of the jQuery file or, if that doesn’t indicate it, right into the jQuery file where the version usually is displayed prominently. You can then compare it with the version number shown on http://jquery.com – and get the latest version right away if applicable.
Great advice, thanks.
By the way, I have NOT clicked your link.
This is what I ended up with:
Code:
function setGlossLinkListeners()
{
$('a.glossaryLink').live("click", function(event){
onRollOverPULink();
});
}
But now I have another problem. When the link is clicked, it seems that the function onRollOverPULink() is running multiple times.