load JS at end

Added by Marcelo Antunes 3 months ago

Usually, on an HTML document it's possible to include js at end, in order to that js is just applyed at end of page render.
It's possible doing the same on wt?
I already tried to put the require methods after i insert the widgets on the page, but it doesn't work.


Replies (2)

RE: load JS at end - Added by Stefan Bn 3 months ago

I guess your question is a little vague.

Basically you load the javascript using WApplication::require, at any point in your code where you want that javascript being executed you use WWidget::doJavaScript.

Check my example here: