Monday, 17 December 2012

Re: RISC OS Javascript support

On Mon, Dec 17, 2012 at 08:20:23AM +0000, Tim Hill wrote:
> In article <4d072bff52.iyojohn@rickman.argonet.co.uk>, John Rickman
> Iyonix <rickman@argonet.co.uk> wrote:
> > Vincent Sanders wrote
>
> > > ok last try for now, ci #744 is built with spidermonkey 1.7.0 maybe
> > > it works maybe it doesn't.
>
> [Snip]
>
> Iyonix RISC OS 5.19 & #744
>
> My results are similar to Vincent's.
>
>
> This works:
> <script type="text/javascript">
> document.write("Hello World . . .") ;
> document.write("<span><i>"+Date()+"<\/i><\/span>") ;
> </script>
>
> This doesn't:
> ..
> <head>
> ..
> <script type="text/javascript">
> function displayDate()
> {
> document.getElementById("demo").innerHTML=Date();
> }
> </script>
> </head><body>
> ..
> <span id="demo">Click button to test Javascript.</span>
> <button type="button" onclick="displayDate()">Display Date</button>
> ..
>
> (these are included on this page on this machine here: http://42.tjrh.eu/)
>
> To have anything working is BRILLIANT! Well done. A christmas present to
> us all. :-)
>

just fyi events set in the *javascript* will work i.e. if you set an
id on the button and did document.getElementById("buttonid").onclick

However innerHTML and outerHTML are not implemented and nor is dynamic
layout so changing teh DOM post page load is currently not
shown. There are examples of working tests in the source [1] and
specifically event-onclick.html would be relevant here.

[1] http://git.netsurf-browser.org/netsurf.git/tree/test/js


--
Regards Vincent
http://www.kyllikki.org/

No comments:

Post a Comment