2 sam2kb Mar 16, 2012 13:33

sam2kb wrote:
It's works exactly like you said right now.
In v5 you'll be able to add custom HTML before closing body, right from backoffice.
well when i add require_js inside any other function it did not work.. i will double check tomorrow.
I think I misunderstood you. If you want to load some scripts before closing body, you can't do that with require_js.
Just output the scripts in SkinEndHtmlBody method. If they require jQuery, include it as usual with require_js('#jquery#'); in SkinBeginHtmlBody
sam2kb wrote:
I think I misunderstood you. If you want to load some scripts before closing body, you can't do that with require_js.
Just output the scripts in SkinEndHtmlBody method. If they require jQuery, include it as usual with require_js('#jquery#'); in SkinBeginHtmlBody
yea but with require_js you avoid loading scripts multiple times.
if i just include scripts with <script></script> iniside SkinEndHtmlBody, you have the risk of loading duplicate scripts.Am i not right ?
You are right. Then the only option you have is load them in the <head> with require_js
sam2kb wrote:
You are right. Then the only option you have is load them in the <head> with require_js
well at least let that be my feature request for v5. Because i think you would agree that loading scripts in <head> is not always the best practice.
It's works exactly like you said right now.
In v5 you'll be able to add custom HTML before closing body, right from backoffice.