Can you put your Ad div to IFrame ?
On Wed, Nov 27, 2013 at 11:20 AM, Lidija Dolinar <lidija....@gmail.com>wrote: > Thiago, thank you for your suggestion. > The contents of OAS_AD JavaScript function is returned from an ad server > and I have no control over it. > > I tried to use the Tapestry.ZONE_UPDATED_EVENT, but to no avail. > > TML contents of the example: > > <t:zone t:id="timeZone" id="timeZone"> > Current time: ${time} > </t:zone> > > <!-- Ad --> > <div id="smsAdvert"> > <script type="text/javascript"> > function displayAd() { > OAS_AD('Bottom1'); > } > </script> > </div> > <!-- /Ad --> > > > Java: > > @AfterRender > void afterRender() { > > javaScriptSupport.addScript("jQuery('#%s').on(Tapestry.ZONE_UPDATED_EVENT, > function() { displayAd() });", timeZone.getClientId()); > } > > > displayAd() function is triggered, ad is being displayed, but the effect is > the same as before - on the whole page only ad is displayed, any other > contents is lost. > > One possible solution that I could think of was to create a separate page > to retrieve the ad and then include that page's HTML with an AJAX request. > But this assumption proved to be wrong, this also doesn't work - I'm still > playing around with it to see if there's any way to make it work. > > It seems I'm stuck. Any other ideas? > > Lidija > > > > > On Tue, Nov 26, 2013 at 11:29 AM, Thiago H de Paula Figueiredo < > thiag...@gmail.com> wrote: > > > On Tue, 26 Nov 2013 04:33:35 -0200, Lidija Dolinar <lidija....@gmail.com > > > > wrote: > > > > Hi, > >> > > > > Hi! > > > > > > I need to display a zone, containing javascript code that contains > >> document.write(). > >> > > > > You know using that function is not recommended at all, right? ;) But > then > > I read that it's being returned from somewhere else . . . > > > > > > How can I properly display zone containing javascript's > document.write()? > >> > > > > The proper way of calling JavaScript code after a Zone update is to > listen > > to the Tapestry.ZONE_UPDATED_EVENT event from the element which is the > Zone. > > > > -- > > Thiago H. de Paula Figueiredo > > Tapestry, Java and Hibernate consultant and developer > > http://machina.com.br > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > -- Dmitry Gusev AnjLab Team http://anjlab.com