<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>I sure can explain that. :-)<br><br>What happens is that the Links bar is populated by simply setting the ".innerHTML" property of the DIV. While that gives you the ability to set the HTML, the Javascript is never run because the following things never happen:<br>1) It doesn't trigger an onload event.<br>2) The inline javascript is not picked up by the interpreter at document load time, so it's not run, precisely because the document isn't "loading."<br><br>Here's what you want to do:<br><br>1) In GM 2.0.1 (which I'm assuming you're running ... or 2.0... either works):<br>a) Set the HTML in your Linksbar to something like:<br><div id="franz-clock"></div><br><br>b) Write the clock updating script in a file "clock.js":<br><br>function update_clock() {<br> var time = new
Date();<br> var time_string = ...; /* place a formatting string of some sort here to format the time */<br> <br> var clock_div = document.getElementById('franz-clock');<br> if(clock_div) {<br> clock_div.innerHTML = time_string;<br>}<br><br>/* this will update the clock every second */<br>setInterval(update_clock, 1000);<br><br>c) Open up geomoose.html<br><br>After the <script ... src="compiled.js" ></script> tag add:<br><br><script type="text/javascript" src="clock.js"></script><br><br>d) Not having tested this code the "setInterval" command may or may not work as predicted... you'll have to test it. If it doesn't work then you'll need to make one more modification...<br><br>Find the <body> tag and find the "onload" attribute. This is a bunch of javascript. At the end of it add...<br><br>onload="
... ; setInterval(update_clock, 1000);<br><br><br>Now, in all honesty, this is generally a bad idea because it could break a lot when GM upgrades happen. So, for 2.2 we invented a way for people to do exactly this kind of thing without worrying (as much) about their code being worth nothing when upgrades come down the pike. They're called User Extensions. For protesterity I'm going to give both the "old server link" and the "new server link" to how User Extensions will work in 2.2+.<br><br><span><a target="_blank" href="http://www.geomoose.org/docs/user_extensions.html">http://www.geomoose.org/docs/user_extensions.html</a> - link AFTER about 1/15</span><br><br><span><a target="_blank" href="http://www.geomoose.org/moose/docs/user_extensions.html">http://www.geomoose.org/moose/docs/user_extensions.html</a> - link as it is NOW</span><br><br>In fact, if you browse SVN you can see the ColorChanger.js extension which shows an example
of how to update the interface on a periodic basis using User Extensions.<br><br><br><br></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><b><span style="font-weight: bold;">From:</span></b> FRANZ OKYERE <franzzoa@hotmail.com><br><b><span style="font-weight: bold;">To:</span></b> geomoose-users@lists.sourceforge.net<br><b><span style="font-weight: bold;">Sent:</span></b> Thu, January 7, 2010 2:35:49 PM<br><b><span style="font-weight: bold;">Subject:</span></b> [Geomoose-users] Diplaying Time in menu bar by Html in linksbar tag (mapbook)<br></font><br>
<style><!--
.hmmessage P
{
margin:0px;padding:0px;}
body.hmmessage
{
font-size:10pt;font-family:Verdana;}
--></style>
Dear All,<br><br>I need to display time information in the menu area for my applicaiton and it is not showing up. I have tried all sorts of varying javascript time codes that work. Can anyone explain why the linksbar tag can take html but will ignore my javascript code?<br><br>Thanks.<br><br>Franz Okyere<br><br>GIS Specialist<br>                                            <br><hr>Add other email accounts to Hotmail in 3 easy steps. <a rel="nofollow" target="_blank" href="http://clk.atdmt.com/UKM/go/186394593/direct/01/%20">Find out how.</a></div></div></blockquote>
<!-- cg14.c2.mail.ac4.yahoo.com compressed/chunked Wed Jan 6 06:59:34 PST 2010 -->
</div><br>
</body></html>