also ... is there a better way to handle executing code that's loaded via ajax? something better than ... $('body').click(function(event) { }
On Jul 31, 11:54 am, skatta <[EMAIL PROTECTED]> wrote: > hello, > > just when i thought i had a grip on executing jquery functions from > content that was loaded viaajaxand added to the dom dynamically, i > have this issue withjqModal. > > i'm trying to open a modal window from code that was loaded in via > Javascript. so i use the following, this works on most of my code ... > but this is weird, it will not fire but will trigger the alert. i > tried it without - trigger: '.triggerit' - and that doesn't work > either. > > now, if the content that triggers thejqmodalis already part of the > dom and not anajaxcall, it will work but i need to click it twice! > i'm confused, any ideas? > > here's the code ... > > $('body').click(function(event) { > > if ($(event.target).is('.triggerit')) { > alert("Hi!"); > $('#overlay').jqm({ajax: '@href', overlay:80, trigger: > '.triggerit'}); > return false; > > } > });