tags:

views:

88

answers:

1

Hello,

I am trying to convert my web application into a bookmarklet. It is built on top of dojo framework.

When the user clicks the bookmarklet, dojo is injected on the page via a dynamic script tag (if it does not already exist) and application kicks off from djConfig.addOnLoad. Well, that's the plan anyway.

however, I find that djConfig.addOnLoad is not called at all after dojo is loaded. I am faking it through polling for window.dojo, but am curious if it is an expected behaviour for djConfig.addOnLoad to not be called if dojo is loaded after the dom is built & ready?

I have tried version 1.3.1 as well as 1.2.3.

Thanks Amit

+2  A: 

I am assuming you are triggering the bookmarklet after the web page in the browser loads. If that is the case, set djConfig.afterOnLoad = true -- the option tells Dojo you are loading dojo after the page load and to not wait for the DOMContentLoaded/window onload to fire before triggering addOnLoad callbacks.

jrburke