Mitch,
Try this plug-in.
http://plugins.jquery.com/project/livequery
Chris
On Sep 23, 3:00 pm, mstone42 wrote:
> I am trying to convert a website currently implemented in PHP with
> server-side includes, to not use only Javascript (and jQuery & AJAX).
> The main navigation page has a list of links. Clicking on a link
> pulls in dynamic content and populates a div on the page. I am
> using .live() and .load() to implement:
>
>
> $(function() {
> $("li.link").live("click", function(){
> // grab the id from the LI element
> var linkid = $(this).attr('id');
> // the html page to pull in
> var linkpg = 'content_'+linkid+'.htm';
> // populate the div
> $("#dynamic_content").load(linkpg);});
>
>
> ...
>
> Sample 1
> Sample 2
> Sample 3
>
>
>
> The content is getting pulled in and displays, but if the content
> contains elements that trigger jQuery functionality (e.g. other click
> events, or text formatting based on other parameters), it doesn't
> work. I know this is a binding issue, and if it were just one or two
> events, I'd use trigger() after the load(). But to complicate
> matters, the dynamic content covers a wide variety of events as well
> as manipulations.
>
> I've placed all my jQuery code into a single file, and tried pulling
> in that file via AJAX after the load():
> $.ajax({type:"GET", url:"./inc_jquery.js", dataType:"script"});
> This works with limited success, but not all events are firing, and
> most specifically the non-event stuff.
>
> Is there some way to cover all the variations? Without resorting to
> using a frameset?!?
>
> Thanks,
> Mitch