Solved

Jquery and dynamic content

Posted on 2009-07-14
5
439 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
ID: 24856538
0
 
LVL 7

Expert Comment

by:Seo_Expert
ID: 24856549
Hello

Here is sample example of jquery ajax

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

Author Comment

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

Expert Comment

by:Zyloch
ID: 24856663
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
ID: 24856672
ok, I got it, thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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…

911 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

20 Experts available now in Live!

Get 1:1 Help Now