The embed Element"

From Documentation
 
(10 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
  [Optional][Multiple]
 
  [Optional][Multiple]
  
It specifies the content that shall be added to the output generated and sent to the client when rendering a desktop. The syntax of the content will depend on the client. For Ajax clients, it can be any tags that can be placed inside HTML <tt><head></tt>, such as <tt><script></tt>, <tt><meta></tt> and others.
+
It specifies the content that shall be added to the output generated and sent to the client when rendering a desktop. The syntax of the content will depend on the client. For Ajax clients(browsers), you can put [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head#see_also any tag that can be placed inside HTML <code><head></code>], such as <code><script></code>, <code><meta></code>, and others.
  
For example, if you want to show the progress bar in the center of the browser window, you can specify the following in <tt>zk.xml</tt>.
+
This can be a way to include a javascript code snippet in all pages, e.g. a javascript patch or a custom widget javascript. For example, if you want to show the progress bar in the center of the browser window, you can specify the following:
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 23: Line 23:
 
</source>
 
</source>
  
You can specify multiple <tt>embed</tt> elements and their content be concatenated together.
+
You can specify multiple <code>embed</code> elements and their content be concatenated together.
  
'''External JavaScript File'''
+
=Usage =
  
<source lang='xml' high='5'>
+
Notice that you need to specify your '''application context path''' in the source path. Becuase ZK directly puts the content into a response without any encoding.
 +
<source lang='xml' highlight='4'>
 
<device-config>
 
<device-config>
 
   <device-type>ajax</device-type>
 
   <device-type>ajax</device-type>
 
   <embed><![CDATA[
 
   <embed><![CDATA[
         <script type="text/javascript" src="/applicationContext/zkpatch/lisbox_selectbugfixed.js"></script>
+
         <script type="text/javascript" src="/myapp/zkpatch/lisbox_selectbugfixed.js"></script>
 +
        <link rel="stylesheet" href="/myapp/styles.css">
 
     ]]></embed>
 
     ]]></embed>
 
</device-config>
 
</device-config>
 
</source>
 
</source>
* Line 5: Notice that you need to specify your application context root in the source path.
 
  
 +
{{LastUpdated}}
  
=Version History=
 
{{LastUpdated}}
 
{| border='1px' | width="100%"
 
! Version !! Date !! Content
 
|-
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
|}
 
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Latest revision as of 01:17, 16 November 2022


Syntax:

<embed>any_valid_fragment</embed>
[Optional][Multiple]

It specifies the content that shall be added to the output generated and sent to the client when rendering a desktop. The syntax of the content will depend on the client. For Ajax clients(browsers), you can put any tag that can be placed inside HTML <head>, such as <script>, <meta>, and others.

This can be a way to include a javascript code snippet in all pages, e.g. a javascript patch or a custom widget javascript. For example, if you want to show the progress bar in the center of the browser window, you can specify the following:

<device-config>
	<device-type>ajax</device-type>
	<embed><![CDATA[
 <script type="text/javascript">
     AU_progressbar = function (id, msg) {
         Boot_progressbox(id, msg, 0, 0, true, true);
     };
 </script>
     ]]></embed>
</device-config>

You can specify multiple embed elements and their content be concatenated together.

Usage

Notice that you need to specify your application context path in the source path. Becuase ZK directly puts the content into a response without any encoding.

<device-config>
   <device-type>ajax</device-type>
   <embed><![CDATA[
        <script type="text/javascript" src="/myapp/zkpatch/lisbox_selectbugfixed.js"></script>
        <link rel="stylesheet" href="/myapp/styles.css">
    ]]></embed>
</device-config>


Last Update : 2022/11/16




Last Update : 2022/11/16

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