BEE and JavaScript
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    > BEE Variables
    > BEE Syntax
    > BEE Commands
    > Database Operation
    > Content Management
    > Objects and Classes
    v Interface with others
       o BEE and HTML
       o BEE and JavaScript
       > BEE and PHP
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> Interface with others >> BEE and JavaScript <=  =>      <  1  >  
BEE interface with JavaScript

JavaScript is a client-side language and is therefore part of the visible web page source.  BEE can build JavaScript by outputting its code.  For example, the following build a JavaScript array variable from a BEE (server side) array:

display '<script language="JavaScript">\n';

display 'var jsCars = new Array\n';

foreach (cars as model)

   display 'jsCars["{model:key}"] = "{model}";\n';

display '</script>\n';

 

BEE can conditionally turned on or off section of JavaScript:

if ('{scheme%discount}')

{

display '<script language="JavaScript">\n';

display 'price = price * (1 – {scheme%discount} / 100);\n';

display 'alert("Now you can get {scheme%discount}% discount!");\n';

display '</script>\n';

}

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd