[Ur] calling javascript code in <dyn>
Adam Chlipala
adamc at csail.mit.edu
Mon Oct 22 18:59:24 EDT 2018
Here's a hypothesis: if you return a <div onload={...}> at the top level
of a generated page (after adding the attribute by changing basis.urs),
it will actually do what you expect. However, if you embed such a <div>
within dynamically generated content, even the /initial value/ of such a
dynamic region, the 'onload' handler is not called. The reason is that
the dynamically generated <div> actually isn't there at the moment when
the page loads; it is only created by JavaScript code running thereafter.
Does that hypothesis seem to match your prior situation?
On 10/22/18 6:50 PM, Fabrice Leal wrote:
> @AdamChlipala
>
> At the time I implemented an onload attribute for <div> on basis.ur
> and only later found out if was for no good on html/js land: the only
> onload that gets triggered is the one defined on <body>, setting
> onload for any other child tag has no "side effects"; so I scrapped that.
>
> Sorry for the vagueness :)
>
> I did end up using <active code={...} /> and that worked for me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20181022/a16ffde1/attachment.html>
More information about the Ur
mailing list