cone13cone
asked on
Jquery and dynamic content
Hello,
I am currently trying to learn javascript by way of the missing manual: javascript. I was starting to get a hand on javascript until I started using jquery. My problem is that I can not figure out how to access dynamic content with jquery. Been looking on the net for hours but was unable to come up with a solution.
The code below applys the greybox function to all ('inpage a'). The problem I am having is not with the initial page, but when I dynamically load content with Ajax. I guess i need a way to recall the function and reapply it to the dynamically loaded content.
I thought I was on to something with the .live but was unable to successfully implement it, thanks in advance.
I am currently trying to learn javascript by way of the missing manual: javascript. I was starting to get a hand on javascript until I started using jquery. My problem is that I can not figure out how to access dynamic content with jquery. Been looking on the net for hours but was unable to come up with a solution.
The code below applys the greybox function to all ('inpage a'). The problem I am having is not with the initial page, but when I dynamically load content with Ajax. I guess i need a way to recall the function and reapply it to the dynamically loaded content.
I thought I was on to something with the .live but was unable to successfully implement it, thanks in advance.
<script type="text/javascript">
$(document).ready(function() {
var gbOptions = {
gbWidth: 700,
gbHeight: 550
};
$('.inpage a').greybox(gbOptions);
});
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
any example codes i keep trying the jquery sites but im not having any luck.
We really need to see more code; maybe your AJAX code, a demo page, or the code you've been trying on the jQuery sites that isn't working for you.
ASKER
ok, I got it, thanks.
Here is sample example of jquery ajax
http://www.sitepoint.com/article/ajax-jquery/