tags:

views:

229

answers:

2

I have a list of reviews, and when you add a review it posts to a PHP page and then loads a Smarty template into the beginning of the review list to show the review you just posted.

That works fine. However, I use a rounded corners plugin and timeago on the review post. I tried re-calling these functions after it loads the review, but that doesn't work either.

I am aware that using .live is approprite for fixing this problem in many other cases, but I don't know how I could apply that here. jquery's .live only works on events. What is the event here?

Any ideas?

For reference: jquery timeago plugin: http://timeago.yarp.com/ jquery corner plugin: http://www.methvin.com/jquery/jq-corner-demo.html

--

As requested, here is some elaboration: I use $.load to load the template content into the div area. There are no errors from this. It works perfectly, with the exception of the timeago/corner plugins not affecting the output.

I don't have the code accessible to me right now, but it goes a little something like this:

$.load('/inc/templateLoader.php?tpl=reviews');
$('abbr.timeago').timeago();
$('.corner').corner();

Some people have suggested it might not be working because $.load can complete before the page loads, which would cause the issue I am experiencing.

A: 

Firefox and the Firebug plugin are your friends. Install, reload the page, and look at the errors on the console tab.

Peter Rowell
As noted above, there are no errors. I have both of those things and I am aware of how to use them.
iddqd
+1  A: 

For those interested, the problem was that the page wasn't finished loading when I was re-applying the corner and timeago effects. I solved the problem by using $.get and then re-applying the corner/timeago stuff inside of the success callback.

iddqd