got to thinking, how would one start with an index.html and include*.ssjs
& *.js files? I tried using the standard:
<script myscript="server"> load('some.js');
... do some half baked s...tuff ...
</script> ... likely a few other type thingies
Re: SBBS Web
By: Mortifis to All on Mon Feb 11 2019 13:40:21
got to thinking, how would one start with an index.html and include *.ssjs
& *.js files? I tried using the standard:
Don't get tripped up by client-side vs. server-side JS for starters:
<script myscript="server"> load('some.js');
... do some half baked s...tuff ...
</script> ... likely a few other type thingies
This would be part of the HTML document that's sent to the client. The server won't do any magic on that load() statement. The client's browser would try to
call a function named 'load', and presumably produce an error.
The .ssjs scripts are executed on the server side, so:
load('some.js');
writeln('<html><body>');
var poop = some_server_side_function(); // Let's say it returns string 'poop'
writeln(poop);
writeln('</body></html>');
That'd do some stuff on the server and send some stuff to the browser.
Alternately you can use a .xjs file, which is an HTML document with some SSJS embedded that the server will process/render and then send to the client:
<html>
<body>
<?xjs
load('some.js');
var poop = some_server_side_function();
<h1><?xjs write(poop); ?></h1>
<script type="text/javascript">
// Let's mix client and server-side JS for added confusion
alert('<xjs write(poop); ?>');
</script>
</body>
</html>
This is similar to inline PHP.
---
echicken
other than no output the only error was no output of my half baked scruff ..
oh, is there anything I need to pre-load ( ie: for php I need php installed to use <?php ...?> to have an xjs execute?
First, my apologies for sounding ADAF, my coding history is TP7 and AMP ...got
'ben playing with a custom theme for my site and haven't been able to get things the way I'd like (starting with the root/index.ssjs file ... so I
to thinking, how would one start with an index.html and include *.ssjs & *.js files? I tried using the standard:
<script myscript="server"> load('some.js');
... do some half baked s...tuff ...
</script> ... likely a few other type thingies
but ain't getting squat for output.
Anyone care to help an ol'dog learn some new tricks?
I was looking through webv4 directory, where is the Who's Online Other Systems called from?
Re: SBBS Web
By: Mortifis to echicken on Wed Feb 13 2019 02:36 pm
I was looking through webv4 directory, where is the Who's Online Other Systems called from?
Looks like: sidebar/001-nodelist.xjs
I had 'scooped' sidebar/001-nodelist.xjs and plopped it in my theme members for use but it seems to require being called somehow because I am
getting a blank page so was wondering how does webv4 interact with 001.nodelist.xjs ?
Re: Re: SBBS Web
By: Mortifis to Digital Man on Thu Feb 14 2019 10:53:50
I had 'scooped' sidebar/001-nodelist.xjs and plopped it in my theme members for use but it seems to require being called somehow because I am
I'm not quite sure what this means. Can you elaborate?
becauseRe: Re: SBBS Web
By: Mortifis to Digital Man on Thu Feb 14 2019 10:53:50
I had 'scooped' sidebar/001-nodelist.xjs and plopped it in my theme members for use but it seems to require being called somehow
I am
I'm not quite sure what this means. Can you elaborate?
I am playing writing a web interface and had asked how to display theonline
users on other bbses similar to webv4 didebar
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 226:53:50 |
Calls: | 6,624 |
Calls today: | 6 |
Files: | 12,171 |
Messages: | 5,318,701 |