[ColdBox 3.5.1] Add asset before the end of document

I would like to know if there is a way to add javascript before the tag.

I need to put my javascript at the end of document.

Using addAsset() I will have my javascript on the head tag.

Is possible to add at the end?

You should accomplish this using your layout.

Could you give more details?

I should use different layout for different pages?

Perhaps this can help: http://aarongreenlee.com/share/coldbox-resource-asset-management/

With this I could output my asset in any part of document?



I’ve tried your script, and is exactly what I was looking for.

But I would have more details about difference between queue and include: what are the difference?

I have used exactly the same code on your example.

Many thanks!!!


If I recall correctly the idea was that “include” would allow you to seed JavaScript in the document body. So you could include JavaScript like “foo = ‘bar’;” and queue JavaScript files.

I think you just care about queue.

Glad it helped.