This is an automated email from the ASF dual-hosted git repository.
adelbene pushed a commit to branch wicket-9.x
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/wicket-9.x by this push:
new c2ffe01 Fixed doceumntation for JavaScriptHeaderItem
c2ffe01 is described below
commit c2ffe01d997ee38e092fe920d128ca9bc5fc16da
Author: Andrea Del Bene <[email protected]>
AuthorDate: Tue Dec 21 17:44:15 2021 +0100
Fixed doceumntation for JavaScriptHeaderItem
---
wicket-user-guide/src/main/asciidoc/resources/resources_4.adoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_4.adoc
b/wicket-user-guide/src/main/asciidoc/resources/resources_4.adoc
index 2491f36..abc461d 100644
--- a/wicket-user-guide/src/main/asciidoc/resources/resources_4.adoc
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_4.adoc
@@ -6,7 +6,7 @@ Wicket comes with interface
_org.apache.wicket.markup.html.IHeaderContributor_ w
Header entries are instances of abstract class
_org.apache.wicket.markup.head.HeaderItem_. Wicket provides a set of built-in
implementations of this class suited for the most common types of resources.
With the exception of _PriorityHeaderItem_, every implementation of
_HeaderItem_ is an abstract factory class:
* *CssHeaderItem:* represents a CSS resource. Factory methods provided by this
class are _forReference_ which takes in input a resource reference, _forUrl_
which creates an CSS item from a given URL and _forCSS_ which takes in input an
arbitrary CSS string and an optional id value to identify the resource.
-* *JavaScriptHeaderItem:* represents a JavaScript resource. Just like
_CssHeaderItem_ it provides factory methods _forReference_ and _forUrl_ along
with method _forScript_ which takes in input an arbitrary string representing
the script and an optional id value to identify the resource. Method
_forReference_ also supports boolean parameter _defer_ which renders the
namesake attribute in the script tag (_defer_ attribute indicates that our
script must be execute only after the page has loaded).
+* *JavaScriptHeaderItem:* represents a JavaScript resource. Just like
_CssHeaderItem_ it provides factory methods _forReference_ and _forUrl_ along
with method _forScript_ which takes in input an arbitrary string representing
the script and an optional id value to identify the resource. The returned type
_JavaScriptReferenceHeaderItem_ exposes some interesting setting methods like
_setDefer_ and _setAsync_ which ca be used to use the corresponding attributes
for https://www.w3schools.com [...]
* *OnDomReadyHeaderItem:* it adds JavaScript code that will be executed after
the DOM has been built, but before external files (such as picture, CSS,
etc...) have been loaded. The class provides a factory method _forScript_ which
takes in input an arbitrary string representing the script to execute.
* *OnEventHeaderItem:* the JavaScript code added with this class is executed
when a specific JavaScript event is triggered on a given DOM element. The
factory method is _forScript(String target, String event, CharSequence
javaScript)_, where target is the id of a DOM element (or the element itself),
event is the event that must trigger our code and javaScript is the code to
execute.
* *OnLoadHeaderItem:* the JavaScript code added with this class is executed
after the whole page is loaded, external files included. The factory method is
_forScript(CharSequence javaScript)_.