link"
m (correct highlight (via JWB)) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
[if="..."] [unless="..."]?> | [if="..."] [unless="..."]?> | ||
− | + | {{versionSince| 3.6.2}} | |
− | It specifies an element that should be generated inside the | + | It specifies an element that should be generated inside the <code><head></code> element. It is generated '''after''' ZK default JavaScript and CSS files. Thus, it can override ZK default CSS. Currently, only HTML-based clients (so-called browsers) support them. Furthermore, HTML <code><link></code> is actually generated for each of this declaration. |
− | + | You can specify whatever attributes you like; it is up to a browser to interpret. ZK only encodes the URI of the <code>href</code> and <code>src</code> attribute (by the use of the <code>encodeURL</code> method of the <code>Executions</code> class). ZK generates all other attributes directly to the client. | |
− | Notice that these header directives are effective only for the main ZUL page. In other words, they are ignored if a page is included by another | + | Notice that these header directives are effective only for the main ZUL page. In other words, they are ignored if a page is included by another page or servlets. Also, they are ignored if the page is a <code>zhtml</code> file. |
<syntaxhighlight line lang="xml" > | <syntaxhighlight line lang="xml" > | ||
Line 17: | Line 17: | ||
href="/rssfeed.php"?> | href="/rssfeed.php"?> | ||
<?link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"?> | <?link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"?> | ||
− | <?link | + | <?link rel="stylesheet" type="text/css" href="~./zul/css/ext.css.dsp"?> |
<window title="My App"> | <window title="My App"> | ||
Line 25: | Line 25: | ||
=Alternatives= | =Alternatives= | ||
− | In addition, you could use [[ZK_Component_Reference/Essential_Components/ | + | In addition, you could use [[ZK_Component_Reference/Essential_Components/Script| Script component]] to embed JavaScript code. The Script component supports more features such as defer, but it has some memory footprint on the server (since it is a component). |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{ZUMLReferencePageFooter}} | {{ZUMLReferencePageFooter}} |
Latest revision as of 09:46, 31 August 2023
Syntax:
<?link [href="uri"] [name0="value0"] [name1="value1"] [name2="value2"] [if="..."] [unless="..."]?>
Since 3.6.2
It specifies an element that should be generated inside the <head>
element. It is generated after ZK default JavaScript and CSS files. Thus, it can override ZK default CSS. Currently, only HTML-based clients (so-called browsers) support them. Furthermore, HTML <link>
is actually generated for each of this declaration.
You can specify whatever attributes you like; it is up to a browser to interpret. ZK only encodes the URI of the href
and src
attribute (by the use of the encodeURL
method of the Executions
class). ZK generates all other attributes directly to the client.
Notice that these header directives are effective only for the main ZUL page. In other words, they are ignored if a page is included by another page or servlets. Also, they are ignored if the page is a zhtml
file.
1 <?link rel="alternate" type="application/rss+xml" title="RSS feed"
2 href="/rssfeed.php"?>
3 <?link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"?>
4 <?link rel="stylesheet" type="text/css" href="~./zul/css/ext.css.dsp"?>
5
6 <window title="My App">
7 My content
8 </window>
Alternatives
In addition, you could use Script component to embed JavaScript code. The Script component supports more features such as defer, but it has some memory footprint on the server (since it is a component).