Solved

Jquery and dynamic content

Posted on 2009-07-14
5
440 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to dynamically set the form action using jQuery.
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…

805 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