Ah, OK. I guess there's a reason for the disclaimer at the top ("This book is badly out of date and will probably never be updated."), then.

On 2010-04-16 09:02, Will Tran wrote:
Thank you. I found the tutorial on this page at
http://diveintogreasemonkey.org/helloworld/code.html. I thought that
this was some weird voodoo thing you have to do to get the sandbox to
work properly. I got it working using the code above.

Thanks,
Will

On Apr 16, 1:10 am, cc<[email protected]>  wrote:
What tutorial is that? That's not standard Greasemonkey style at all,
and won't work properly because of security restrictions
<http://wiki.greasespot.net/UnsafeWindow>.

Much better is something along the following lines:

function helloWorld() {
      alert('hello world');}

window.setTimeout(helloWorld, 60);

Note the use of the function's name as a symbol directly (rather than
inside a string) and without calling it (there are no parentheses
immediately following its reference in setTimeout). That saves a
reference to the function object itself for setTimeout to call. (This
works in ordinary JavaScript too; it's not a GM-specific feature at all.)

On 2010-04-15 19:38, Will Tran wrote:>  Hey. This is installing properly, but 
javascript won't run properly
for me. I am on a Mac with Firefox 3.6.3. I tried doing
window.helloworld = function() from the tutorial and do a setTimeout.
I keep getting an error that helloworld is not defined.
window.helloworld = function() {
       alert('hello world');
};
window.setTimeout('helloworld()', 60);
--
cc | pseudonymous |<http://carlclark.mp/>

--
~ If I am nobody and nobody is perfect does that mean that I am
perfect?  Yes, yes, it does. ~http://tagzilla.mozdev.orgv0.066

--
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group 
athttp://groups.google.com/group/greasemonkey-users?hl=en.

--
cc | pseudonymous |<http://carlclark.mp/>


--
~ Think honk if you're telepathic. ~ http://tagzilla.mozdev.org v0.066

--
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to