Are you using Firebug by any chance? It's a great resource for helping
debug JavaScript errors in Firefox (among many other things). If
you're not, I seriously recommend it:

http://getfirebug.com/

I was able to get your gadget to work by replacing the following line
with the line below it. You were missing the assignment operator (or
rather, it came too late in the expression):

ORIGINAL:
document.getElementById('info').innerHTML 'timer: ' += timer +
'<br>';

MODIFIED:
document.getElementById('info').innerHTML = 'timer: ' + timer +
'<br>';

Let me know if your gadget still doesn't work after doing this (it
does for me). In either case, orkut isn't blocking timeouts so this
isn't the issue.

- Jason

On Sep 28, 7:34 am, John <[EMAIL PROTECTED]> wrote:
> I am experiencing a problem using the setTimeout() function. For some
> reason it does not work in Firefox 3 on Orkut. In the testcase I made
> it should display the text "Done waiting!" after 5 seconds, but in
> Firefox nothing happens, no errors are set either. If I load the
> application in Safari it works fine, when I test the JavaScript code
> in a plain HTMl document it also works fine in Firefox, which makes me
> think that the Orkut sandbox is doing something that interferes with
> my code, but I have no idea what it can be.
>
> I have tried many variations of passing the arguments to the
> setTimeout() function and even setInterval(), but it either fires
> immediately or not at all. I have been unable to make the script pause
> on Orkut with Firefox.
>
> Is there anybody who can help me with this?
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <Module>
>   <ModulePrefs title="Timeout test">
>     <Require feature="opensocial-0.7" />
>   </ModulePrefs>
>   <Content type="html">
>     <![CDATA[
>     <script type="text/javascript">
>
>         function init() {
>
>                 document.getElementById('info').innerHTML += 'Wait 5
> seconds...<br>';
>
>                 var timer = setTimeout(function() {doneWaiting()}, 5000);
>
>                 document.getElementById('info').innerHTML 'timer: ' += timer +
> '<br>';
>         }
>
>         function doneWaiting() {
>
>                 document.getElementById('info').innerHTML += 'Done 
> waiting!<br>';
>         }
>
>         gadgets.util.registerOnLoadHandler(init);
>
>     </script>
>
>     <div id="info">
>
>     </div>
>
>     ]]>
>   </Content>
> </Module>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to