How to add javascript to JBrowse after everything has loaded

I am trying to add a script tag to the body of index.html in JBrowse 11.5. I want it to execute after everything has loaded. All CSS, asynchronously loaded tracks, and so on. I've tried domReady! and dom / ready, but they run too early. Does anyone know how to add a script after loading?

+3


source to share


1 answer


It may depend on what you mean by "whatever loads", but you can try several different methods.

For example in index.html you can write something like this

JBrowse.afterMilestone('initView', function() {
    // add your code to inject script here
})

      



You can just add arbitrary javascript in there, enable new AMD modules, or use a different input code input method for example. insert script tag with removed src and wait for it to execute

Alternatively, check the plugin architecture for JBrowse, this is also a good way to include new code modules

0


source







All Articles