[Ur] Body onload handlers do not cause scripts to be included

Daniel Patterson dbpatterson at riseup.net
Mon Mar 11 10:16:18 EDT 2013


On the current public mercurial version, I've experienced the same problem.

To work around it, I created a single source that I never used; this caused
the script tags to be included. Note that this was particularly odd given
that I had "script" declarations in my .urp file, and they were also not
included - maybe I'm not understanding how script declarations are supposed
to work, but it surprised me.

I haven't minimized it, but the project is online, and the particular lines
/ workaround are at:

http://hub.darcs.net/dbp/dnplayer/browse/dn.ur#142


On Sat, Mar 9, 2013 at 2:17 PM, Adam Chlipala <adamc at csail.mit.edu> wrote:

> On 03/09/2013 02:13 PM, Istvan Chung wrote:
>
>> If a page is created in which the only indicator that javascript must be
>> used is the<body onload={...}>  tag, then the compiler fails to
>> recognize that it must insert the<script>  tags in the head of the page.
>>
>> For example,
>>
>> fun main () =
>> return<xml>
>>    <head>
>>      <title>Example</title>
>>    </head>
>>
>>    <body onload={alert "Client-side code"}>
>>    </body>
>> </xml>
>>
>> does not alert anything because the application's script is not
>> included.
>>
>>
>
> Hm... I made a test case out of just your example 'main' function, and it
> works fine for me with the latest Ur/Web version from the public Mercurial
> repository.  Is that the Ur/Web version you're using, too?
>
>
> ______________________________**_________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/**cgi-bin/mailman/listinfo/ur<http://www.impredicative.com/cgi-bin/mailman/listinfo/ur>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20130311/08046963/attachment.html>


More information about the Ur mailing list