The context of "this" is probably what is breaking. That particular keyword is deceptively similar to java this but much more specific.
in a block like : dojo.addOnLoad(function(){ }); "this" refers to the closest containing object. In this case that would be the anonymous function(){} object. If you want to bind to something like the window being loaded reference window.onLoad.bindAs.... If it's the document you want to do it on do document.onLoad.bindAs<blah bah> ...Etc.. etc.. On 1/16/07, Chris Norris <[EMAIL PROTECTED]> wrote:
Please bear with me though this explanation. We have some code that is broken, I believe, by the inclusion of all script initialization code in a dojo.addOnLoad call. The code this is being broken is a call to Scriptaculous' Event.observe: Event.observe(this.picture, "load", this.onLoad.bindAsEventListener(this)); Even after this.picture loads, the this.onLoad function is never called. If, however, we take this code out of an <initialize> block in a script file and just include it in the html template in a normal Javascript block, it works fine. Something about dojo.addOnLoad is breaking the Scriptaculous Event handling. Has anyone ran into anything like this? If I didn't make the problem clear, let me know. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]