[dev] addScriptFile() comes too late

Sebastian Birnbach birnbacs at gmail.com
Tue Jun 5 10:32:07 UTC 2018


Ralf,

to make a long story short: you are right, my event listener was
incorrectly set up.
You helped me a lot again, thanks a ton!



2018-06-05 10:51 GMT+02:00 Ralf Lang <lang at b1-systems.de>:

>
>
> Am 04.06.2018 um 12:17 schrieb Sebastian Birnbach:
>
>> All *.js scripts added to page_output e.g. via
>>
>> $GLOBALS['page_output']->addScriptFile('foo.js');
>>
>> are written to the very end of the HTML page, just before '</html>'
>>
>>
>> My page renders several Horde_View subpages, one of which calls a function
>> in foo.js. However, as the *.js files are not loaded at the time of
>> function call, the function is not found.
>>
>> Is there a Horde way to include a JS script file earlier on in the HTML
>> code?
>>
> I do not fully understand. You should wait for the page loaded event if
> you run javascript which depends on certain resources already loaded.
>
> Regards
>
> Ralf
> --
> dev mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>


More information about the dev mailing list