link"

From Documentation
m
Line 2: Line 2:
 
<syntax lang="xml" >
 
<syntax lang="xml" >
 
  <?link [href="uri"] [''name0''="''value0''"] [''name1''="''value1''"] [''name2''="''value2''"] [if="..."] [unless="..."]?>
 
  <?link [href="uri"] [''name0''="''value0''"] [''name1''="''value1''"] [''name2''="''value2''"] [if="..."] [unless="..."]?>
<?meta [''name0''="''value0''"] [''name1''="''value1''"] [''name2''="''value2''"] [if="..."] [unless="..."]?>
 
<?script type="text/javascript" [src="uri"] [charset="encoding"]
 
  [content="javascript"] [if="..."] [unless="..."]?>
 
 
</syntax>
 
</syntax>
  
'''Since''' : 3.6.2
+
[since 3.6.2]
  
These are so-called header elements in HTML. They are generated inside the HEAD element. The meta tags are generated before ZK default JavaScript and CSS files, while the other tags are generated after ZK default JavaScript and CSS files. Currently only HTML-based clients (so-called browsers) support them.
+
It specifies an element that shall be generated inside the HEAD element. It is generated ''after'' ZK default JavaScript and CSS files. Thus, it could override ZK default CSS. Currently only HTML-based clients (so-called browsers) support them. Furthermore, HTML LINK tag is actually generated for each of this declaration.
  
Developers can specify whatever attributes with these header directives. ZK only encodes the URI of the <tt>href</tt> and <tt>src</tt> attribute (by use of the <tt>encodeURL</tt> method of the <tt>Executions</tt> class). ZK generates all other attributes directly to the client.
+
Developers can specify whatever attributes you like; it is up to the browser to interpret. ZK only encodes the URI of the <tt>href</tt> and <tt>src</tt> attribute (by use of the <tt>encodeURL</tt> method of the <tt>Executions</tt> 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 pages or servlets. Also, they are ignored if the page is a <tt>zhtml</tt> file.
 
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 pages or servlets. Also, they are ignored if the page is a <tt>zhtml</tt> file.
  
 
<syntax lang="xml" >
 
<syntax lang="xml" >
<?link rel="alternate" type="application/rss+xml" title="RSS feed"
+
<?link rel="alternate" type="application/rss+xml" title="RSS feed"
 
   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  rel="stylesheet" type="text/css" href="~./zul/css/ext.css.dsp"?>
+
<?link  rel="stylesheet" type="text/css" href="~./zul/css/ext.css.dsp"?>
<?script type="text/javascript" src="/js/foo.js"?>
 
<?script type="text/javascript" content="var foo = true;
 
if (zk.ie) foo = false;"?>
 
  
 
  <window title="My App">
 
  <window title="My App">
Line 28: Line 22:
 
  </window>
 
  </window>
 
</syntax>
 
</syntax>
 +
 
==Alternatives==
 
==Alternatives==
In addition to the script directive, you could use [[ZK_Component_Reference/Essential_Components/Script|the script component]] to embed JavaScript code. The script component supports more features such as defer, but it has some memory foot print at the server (since it is a component).
+
In additions, you could use [[ZK_Component_Reference/Essential_Components/Style|the style component]] to embed JavaScript code. The script component supports more features such as defer, but it has some memory foot print at the server (since it is a component).
  
 
==Version History==
 
==Version History==

Revision as of 07:08, 5 November 2010

<syntax lang="xml" >

<?link [href="uri"] [name0="value0"] [name1="value1"] [name2="value2"] [if="..."] [unless="..."]?>

</syntax>

[since 3.6.2]

It specifies an element that shall be generated inside the HEAD element. It is generated after ZK default JavaScript and CSS files. Thus, it could override ZK default CSS. Currently only HTML-based clients (so-called browsers) support them. Furthermore, HTML LINK tag is actually generated for each of this declaration.

Developers can specify whatever attributes you like; it is up to the browser to interpret. ZK only encodes the URI of the href and src attribute (by 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 pages or servlets. Also, they are ignored if the page is a zhtml file.

<syntax lang="xml" > <?link rel="alternate" type="application/rss+xml" title="RSS feed"

 href="/rssfeed.php"?>

<?link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"?> <?link rel="stylesheet" type="text/css" href="~./zul/css/ext.css.dsp"?>

<window title="My App">
    My content
</window>

</syntax>

Alternatives

In additions, you could use the style component to embed JavaScript code. The script component supports more features such as defer, but it has some memory foot print at the server (since it is a component).

Version History

Version Date Content
     



Last Update : 2010/11/05

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.