Hi,

You could do something like this (on a render method):

   Element head = writer.getDocument().find("html/head");
head.elementAt(0, "link", "rel", "stylesheet", "type", "text/css", "href",
       this.defaultCss.toClientURL());

In this case I'm inserting a CSS link.

Todd Orr wrote:
Is there any way to inject a script tag (via a block) defined in a
nested component into the page's head section? I'm trying to create a
component that utilizes some specific js, but I find that including
the js at the point in the page where the component is rendered hacky.

I think that this would be useful in general as sometimes you may
need/prefer to add head content from components while you may not have
access to the Border component. This would come up when creating
reusable libs, for example.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Siddhartha Argollo
Técnico Judiciário
TRE-BA
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to