Including JavaScript and CSS Files

AXVW views may include any number of JavaScript and CSS files:

<js file="ab-my-code.js">
<css file="ab-my-styles.css">

By convention, JS and CSS files associated with a single view are given the same name as the AXVW view file. By default Web Central will assume that the included file is located in the same folder as the view file. You can also specify a relative path to the included file in the file name. If the included file cannot be loaded from the same folder, Web Central will look in search folders specified in the corresponding file category in \WEB-INF\config\context\compatibility\afm-config.xml .

You can also include files from a different web server, for example to use third-party JavaScript libraries deployed using a Content Delivery Network such as Yahoo!:

<js url="http://acme.com/ab-their-code.js">

Web Central includes several libraries out of the box. Web Central uses these libraries internally, and they are also available automatically in any command-and-control view:

  • ab-core\libraries\base : Dean Edwards Base library for building Java Script classes (Base)
  • ab-core\libraries\json JSON support library (JSON-RPC)
  • ab-core\libraries\yui : Yahoo UI libraries used to create Web Central controls ( YUI ).