0

Is there a way to make sure some Prototype.js functions run any time there's a new element added to the page via AJAX? Normally, I'd just use jQuery's live(); but we aren't using that on this site.

In this instance, I've made a tab interface but I know it's going to be called in a lightbox in a few instances. While it works when already on the page, if I load it in via an AJAX call it doesn't work (unsurprisingly).

What's the best way to go about fixing this issue? I did some searching but didn't find a good solution. Had I my preference you wouldn't need to do anything specific. The page would just find them automatically and do what needed to be done. Bonus points for a minimal hit in browser performance through unnecessary calls.

Example: http://designbyadmiral.com/experiments/tab_test.html

dougoftheabaci
  • 665
  • 1
  • 6
  • 19

0 Answers0