Solved

Jquery and dynamic content

Posted on 2009-07-14
5
438 Views
Last Modified: 2012-05-07
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.
<script type="text/javascript">

$(document).ready(function() {

  var gbOptions = {

    gbWidth: 700,

    gbHeight: 550

  };

	$('.inpage a').greybox(gbOptions);

});

</script>

Open in new window

0
Comment
Question by:cone13cone
  • 2
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
Seo_Expert earned 500 total points
Comment Utility
0
 
LVL 7

Expert Comment

by:Seo_Expert
Comment Utility
Hello

Here is sample example of jquery ajax

http://www.sitepoint.com/article/ajax-jquery/
0
 

Author Comment

by:cone13cone
Comment Utility
any example codes i keep trying the jquery sites but im not having any luck.
0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
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.
0
 

Author Comment

by:cone13cone
Comment Utility
ok, I got it, thanks.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now