Skip to content
  • deuce's avatar
    758bd8ab
    A much better xjs handler... works as follows: · 758bd8ab
    deuce authored
    1) If the *.xjs.ssjs file exists and is newer than the *.xjs file, simply
       load()s the *.xjs.ssjs file.
    2) Otherwise, generates the *.xjs.ssjs file from the *.xjs file as follows:
       Anything inside the tag <?xjs ... ?> is SSJS.
    
    A simple welcome.xjs page would then be as follows:
    <html>
    <head>
    <title><?xjs write(system.name)?></title>
    </head>
    <body>
    Your SysOp <?xjs write(system.operator)?> would like to welcome you to
    <?xjs write(system.name) ?>
    </body>
    </html>
    
    This is converted to welcome.xjs.ssjs as follows:
    writeln('<html>');
    writeln('<head>');
    write('<title>');
    write(system.name);
    writeln('</title>');
    writeln('</head>');
    writeln('<body>');
    write('Your SysOp ');
    write(system.operator);
    writeln(' would like to welcome you to');
    write('');
    write(system.name) ;
    writeln('</body>');
    writeln('</html>');
    
    Now all you PHP folks out there can get comfortable writing XJS scripts
    if I understand how PHP embedding works.
    758bd8ab
    A much better xjs handler... works as follows:
    deuce authored
    1) If the *.xjs.ssjs file exists and is newer than the *.xjs file, simply
       load()s the *.xjs.ssjs file.
    2) Otherwise, generates the *.xjs.ssjs file from the *.xjs file as follows:
       Anything inside the tag <?xjs ... ?> is SSJS.
    
    A simple welcome.xjs page would then be as follows:
    <html>
    <head>
    <title><?xjs write(system.name)?></title>
    </head>
    <body>
    Your SysOp <?xjs write(system.operator)?> would like to welcome you to
    <?xjs write(system.name) ?>
    </body>
    </html>
    
    This is converted to welcome.xjs.ssjs as follows:
    writeln('<html>');
    writeln('<head>');
    write('<title>');
    write(system.name);
    writeln('</title>');
    writeln('</head>');
    writeln('<body>');
    write('Your SysOp ');
    write(system.operator);
    writeln(' would like to welcome you to');
    write('');
    write(system.name) ;
    writeln('</body>');
    writeln('</html>');
    
    Now all you PHP folks out there can get comfortable writing XJS scripts
    if I understand how PHP embedding works.
Loading