Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #36105 > unrolled thread

Server side JS programming

Started bygroovee@cyberdude.com
First post2019-03-12 06:17 -0700
Last post2019-03-19 23:15 +0100
Articles 20 on this page of 22 — 7 participants

Back to article view | Back to comp.lang.javascript


Contents

  Server side JS programming groovee@cyberdude.com - 2019-03-12 06:17 -0700
    Re: Server side JS programming "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-03-12 22:03 +0100
      Re: Server side JS programming groovee@cyberdude.com - 2019-03-13 06:14 -0700
        Re: Server side JS programming "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-03-13 15:14 +0100
    Re: Server side JS programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-03-13 15:36 +0100
      Re: Server side JS programming groovee@cyberdude.com - 2019-03-14 07:04 -0700
        Re: Server side JS programming Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-03-15 12:25 +0000
          Re: Server side JS programming "Mark-" <nospam@mapson.xyz> - 2019-03-15 12:49 +0000
          Re: Server side JS programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-03-17 16:02 +0100
            Re: Server side JS programming John G Harris <niam@jghnorth.org.uk.invalid> - 2019-03-17 15:34 +0000
            Re: Server side JS programming "Mark-" <nospam@mapson.xyz> - 2019-03-17 17:06 +0000
            Re: Server side JS programming groovee@cyberdude.com - 2019-03-17 20:32 -0700
              Re: Server side JS programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-03-18 12:49 -0700
                Re: Server side JS programming groovee@cyberdude.com - 2019-03-19 06:20 -0700
                  Re: Server side JS programming Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-03-19 14:23 +0000
                  Re: Server side JS programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-03-19 12:05 -0700
              Re: Server side JS programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-03-19 18:23 +0100
    Re: Server side JS programming Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-03-13 15:22 +0000
    Re: Server side JS programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-03-13 19:16 -0700
      Re: Server side JS programming groovee@cyberdude.com - 2019-03-14 07:00 -0700
    Re: Server side JS programming groovee@cyberdude.com - 2019-03-19 13:52 -0700
      Re: Server side JS programming "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-03-19 23:15 +0100

Page 1 of 2  [1] 2  Next page →


#36105 — Server side JS programming

Fromgroovee@cyberdude.com
Date2019-03-12 06:17 -0700
SubjectServer side JS programming
Message-ID<22440663-d4d8-496c-926c-b1af146faaa5@googlegroups.com>
Hi,
I think I've asked this question before over here, but it seems to have slipped my mind what was said - I'd like to know: is there any way to do server side programming in JS to generate a webpage, with the code bits "inserted" into the HTML bits, like <?php does for PHP? Otherwise, how would you say, print stuff from a MySQL database (assuming you're using node.js) on a webpage? You'd need some way to separately print the MySQL data, and *then* (if it comes afterwards) print the rest of the HTML. Ugh! This is Horrifying! Surely there must be a better solution?

Thanks.

[toc] | [next] | [standalone]


#36106

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-03-12 22:03 +0100
Message-ID<XnsAA10E054FF1Ceejj99@194.109.6.166>
In reply to#36105
groovee@cyberdude.com wrote on 12 Mar 2019 in comp.lang.javascript:

> I think I've asked this question before over here, but it seems to have
> slipped my mind what was said - I'd like to know: is there any way to do
> server side programming in JS to generate a webpage, with the code bits
> "inserted" into the HTML bits, like <?php does for PHP? Otherwise, how
> would you say, print stuff from a MySQL database (assuming you're using
> node.js) on a webpage? You'd need some way to separately print the MySQL
> data, and *then* (if it comes afterwards) print the rest of the HTML.
> Ugh! This is Horrifying! Surely there must be a better solution? 

Using Classic ASP as a platform, you can use Jscript,
which is an nowadays antiquated form of Javascript by Microsoft.

Of course, there is no serverside DOM, so there are other commands to 
interact with that environment. 

<%@ LANGUAGE="jscript" %>
<h3>
<%
var num = 8 / 17;
var yes = true;
if (yes) Response.write( num + ' is not an integer.' );
%>
</h3>

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#36110

Fromgroovee@cyberdude.com
Date2019-03-13 06:14 -0700
Message-ID<1b5e74e9-8a0e-4dd5-988c-016cbc8bcb19@googlegroups.com>
In reply to#36106
On Wednesday, 13 March 2019 02:33:16 UTC+5:30, Evertjan.  wrote:
> 
> Using Classic ASP as a platform, you can use Jscript,

Umm....not really a fan of Microsoft at all, bro.
Any other suggestions, anyone...?

[toc] | [prev] | [next] | [standalone]


#36111

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-03-13 15:14 +0100
Message-ID<XnsAA119B157A2CFeejj99@194.109.6.166>
In reply to#36110
groovee@cyberdude.com wrote on 13 Mar 2019 in comp.lang.javascript:

> On Wednesday, 13 March 2019 02:33:16 UTC+5:30, Evertjan.  wrote:
>> 
>> Using Classic ASP as a platform, you can use Jscript,
> 
> Umm....not really a fan of Microsoft at all, bro.
> Any other suggestions, anyone...?

I am not your brother, 
and don't think want to adapt my answer to your post-hoc changes 
in your Q, dependent on your fan fancy of big corporations.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#36112

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-03-13 15:36 +0100
Message-ID<6efb8bff-d77d-b092-e139-ddac798e9777@PointedEars.de>
In reply to#36105
groovee@cyberdude.com wrote:
^^^^^^^^^^^^^^^^^^^^^
How "funny".  Get a real name if you want to be taken seriously from now on.
And be aware that you are talking to potential colleagues, but *strangers*.

> I think I've asked this question before over here, but it seems to have slipped my mind what was said - I'd like to know: is there any way to do server side programming in JS to generate a webpage, with the code bits "inserted" into the HTML bits, like <?php does for PHP?

There has been Server-side JavaScript on Netscape Enterprise Server and its
successors.

Nowadays only ASP (.NET) with JScript (.NET), and Node.js with Google V8
JavaScript come to mind.

<http://pointedears.de/es-matrix/#version-info>

(not up-to-date)

> Otherwise, how would you say, print stuff from a MySQL database (assuming you're using node.js) on a webpage?

This is not “otherwise”, so I do not follow.

> You'd need some way to separately print the MySQL data, and *then* (if it comes afterwards) print the rest of the HTML. 

No, you can wait for the data to arrive.  Also, you can only query and
display chunks of the data, and cache them server-side and client-side.

> Ugh! This is Horrifying! Surely there must be a better solution?

Usually chunking and/or AJAX/XHR/Fetch is the proper solution nowadays.
The programming language used server-side is secondary.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36119

Fromgroovee@cyberdude.com
Date2019-03-14 07:04 -0700
Message-ID<5eb622ab-4401-4af7-9f5a-4921ef92429a@googlegroups.com>
In reply to#36112
On Wednesday, 13 March 2019 20:06:14 UTC+5:30, Thomas 'PointedEars' Lahn  wrote:

> How "funny".  Get a real name if you want to be taken seriously from now on.
> And be aware that you are talking to potential colleagues, but *strangers*.

Er no - I NEVER post under my own name on the net. Been bitten before, second time shy.
Oh - I've had quite a few "conversations" with my old pal Evertjan on over here :) (which mainly consisted of him being the usual sarcy bastard that he is *consistently*!)

[toc] | [prev] | [next] | [standalone]


#36121

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2019-03-15 12:25 +0000
Message-ID<slrnq8n6en.6qm.jon+usenet@sable.unequivocal.eu>
In reply to#36119
On 2019-03-14, groovee@cyberdude.com <groovee@cyberdude.com> wrote:
> On Wednesday, 13 March 2019 20:06:14 UTC+5:30, Thomas 'PointedEars' Lahn  wrote:
>> How "funny".  Get a real name if you want to be taken seriously
>> from now on. And be aware that you are talking to potential
>> colleagues, but *strangers*.
>
> Er no - I NEVER post under my own name on the net. Been bitten
> before, second time shy.

Ignore Pointed 'RealName' Ears, he has imaginary netiquette rules
that he insults almost everyone for breaking. There is no need to
pay any attention to his nonsense.

[toc] | [prev] | [next] | [standalone]


#36122

From"Mark-" <nospam@mapson.xyz>
Date2019-03-15 12:49 +0000
Message-ID<q6g71d$1rab$1@gioia.aioe.org>
In reply to#36121
Jon Ribbens wrote:

> 
> Ignore Pointed 'RealName' Ears, he has imaginary netiquette rules
> that he insults almost everyone for breaking. There is no need to
> pay any attention to his nonsense.

Seconded

[toc] | [prev] | [next] | [standalone]


#36123

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-03-17 16:02 +0100
Message-ID<ea5b2e8f-676c-dcf4-2fc0-94c09889d015@PointedEars.de>
In reply to#36121
Jon Ribbens wrote:
> On 2019-03-14, groovee@cyberdude.com <groovee@cyberdude.com> wrote:
>> On Wednesday, 13 March 2019 20:06:14 UTC+5:30, Thomas 'PointedEars' Lahn  wrote:
>>> How "funny".  Get a real name if you want to be taken seriously
>>> from now on. And be aware that you are talking to potential
>>> colleagues, but *strangers*.
>>
>> Er no - I NEVER post under my own name on the net. Been bitten
>> before, second time shy.

In now 19 years of posting in Usenet under my real name I have never had any
problems with people in real life, despite a host of statements on my part
that were perceived by some to be controversial.  On the contrary, I have
made real-life acquaintances and friends, and the demonstration of my
expertise online helped me to find good, well-paid positions in the software
industry several times.

Assuming your story to be true, probably your problems had to do with *how*
and *what* you posted, as it has to do whether you have the courage to stand
by your own words with your own, real name.  For it is too easy to throw
insults while hiding behind *seeming* anonymity.

> Ignore Pointed 'RealName' Ears, he has imaginary netiquette rules
> that he insults almost everyone for breaking. There is no need to
> pay any attention to his nonsense.

/Argumentum ad hominem./

Jon Ribbens is fully aware that “PointedEars” is my nickname and that it is
customary to include it *in addition to* the real name (not least to avoid
confusion with other people), which in my case is Thomas Lahn.  As it says
in the From header field of each of my postings, in my Twitter account, and
so on.

Showing the simple courtesy to introduce oneself to strangers before
asking for their free help is not a fantasy, let alone mine.  And showing
courtesy when interacting with one another is indeed the core of what is
called “etiquette”; on the Net, “network etiquette” or “netiquette” for short.

As a result, when that courtesy is not shown, one must expect one’s audience
to be greatly reduced to those who do not put much value, if any, in
courtesy.  So it is illogical to expect it from them then.

See also, among other sources:

<http://www.albion.com/netiquette/corerules.html>

To perceive or portray a request for that courtesy as an insult indicates
a twisted sense of reality at best.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36124

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2019-03-17 15:34 +0000
Message-ID<c7qs8e1g44jma6l3er4eaviv74tud2kddo@4ax.com>
In reply to#36123
On Sun, 17 Mar 2019 16:02:36 +0100, Thomas 'PointedEars' Lahn
<PointedEars@web.de> wrote:

  <snip>

>courtesy

  <snip>

Um.

  John

[toc] | [prev] | [next] | [standalone]


#36125

From"Mark-" <nospam@mapson.xyz>
Date2019-03-17 17:06 +0000
Message-ID<q6luqt$12en$1@gioia.aioe.org>
In reply to#36123
Thomas 'PointedEars' Lahn wrote:

> helped me
> to find good, well-paid positions in the software industry several
> times.

Hard time keeping a position? 

> Assuming your story to be true, probably your problems had to do with
> how and what you posted, as it has to do whether you have the courage
> to stand by your own words with your own, real name.  For it is too
> easy to throw insults while hiding behind seeming anonymity.

Now that is some of the best twisted logic I have ever read.

> it is customary to include it *in addition to* the real name (not

In your universe.

> And
> showing courtesy when interacting with one another is indeed the core
> of what is called “etiquette”; on the Net, “network etiquette” or
> “netiquette” for short.

No, no, no. You cannot tell others about courtesy when you so
frequently, and I posit, intentionally, are discourteous.

> To perceive or portray a request for that courtesy as an insult
> indicates a twisted sense of reality at best.

<shaking head> Dude, you are constantly discourteous. So, you have a
"twisted sense of reality". Thanks for confirming.

[toc] | [prev] | [next] | [standalone]


#36126

Fromgroovee@cyberdude.com
Date2019-03-17 20:32 -0700
Message-ID<02edfe0a-4d1f-4c77-8dac-d6f4590e98dc@googlegroups.com>
In reply to#36123
On Sunday, 17 March 2019 20:32:45 UTC+5:30, Thomas 'PointedEars' Lahn  wrote:

> In now 19 years of posting in Usenet under my real name I have never had any
> problems with people in real life, 

OK, TLDR; but - well, good for you, however it was not the case with me. I just... dont' *want* a lot of folks to know what I'm up to, online - is there anything wrong with that??

And I'm not "hiding" under anything, unless you suggest that I travel all the way  to the Netherlands, half a world away, so that I can "chat" with Evertjan :)


...Back to the topic - Michael Haufe, are you there?? :) 

[toc] | [prev] | [next] | [standalone]


#36127

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2019-03-18 12:49 -0700
Message-ID<48cfa151-5df2-4808-b9fa-44f2d6f070f4@googlegroups.com>
In reply to#36126
gro...@cyberdude.com wrote:

> [...]

> ...Back to the topic - Michael Haufe, are you there?? :)

Rarely.

Did you not follow the "Getting started" guide?

<https://expressjs.com/en/starter/installing.html>

<https://expressjs.com/en/starter/hello-world.html>

[toc] | [prev] | [next] | [standalone]


#36133

Fromgroovee@cyberdude.com
Date2019-03-19 06:20 -0700
Message-ID<38c76383-cdcd-47cd-85a7-255078a625e2@googlegroups.com>
In reply to#36127
On Tuesday, 19 March 2019 01:19:30 UTC+5:30, Michael Haufe (TNO)  wrote:
> 
> Rarely.
> 
> Did you not follow the "Getting started" guide?
> 
> <https://expressjs.com/en/starter/installing.html>
> 
> <https://expressjs.com/en/starter/hello-world.html>

I *did* take a cursory look at those pages (and others on that site), but nowhere did I see HTML *interspersed with* server-side Javascript...?

[toc] | [prev] | [next] | [standalone]


#36134

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2019-03-19 14:23 +0000
Message-ID<slrnq91ura.6qm.jon+usenet@sable.unequivocal.eu>
In reply to#36133
On 2019-03-19, groovee@cyberdude.com <groovee@cyberdude.com> wrote:
> On Tuesday, 19 March 2019 01:19:30 UTC+5:30, Michael Haufe (TNO)  wrote:
>> Rarely.
>> 
>> Did you not follow the "Getting started" guide?
>> 
>> <https://expressjs.com/en/starter/installing.html>
>> 
>> <https://expressjs.com/en/starter/hello-world.html>
>
> I *did* take a cursory look at those pages (and others on that
> site), but nowhere did I see HTML *interspersed with* server-side
> Javascript...?

That's because it doesn't do that.

You don't seem to have looked into my suggestion of 'jsdom'.

[toc] | [prev] | [next] | [standalone]


#36136

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2019-03-19 12:05 -0700
Message-ID<f0d716ec-8b5b-4c97-a1e8-af5e3f493f33@googlegroups.com>
In reply to#36133
On Tuesday, March 19, 2019 at 8:20:51 AM UTC-5, gro...@cyberdude.com wrote:
> Michael Haufe (TNO)  wrote:
> > 
> > Rarely.
> > 
> > Did you not follow the "Getting started" guide?
> > 
> > <https://expressjs.com/en/starter/installing.html>
> > 
> > <https://expressjs.com/en/starter/hello-world.html>
> 
> I *did* take a cursory look at those pages (and others on that site), but nowhere did I see HTML *interspersed with* server-side Javascript...?

If you are learning something unfamiliar, then a cursory glance would hardly do you any good. If you spent enough time to actually click the demo on the hello-word page you would see that it responds with a content-type of text/html. That would be enough of a hint to derive that the following is possible:

    app.get('/', (req, res) => res.send('<h1>Hello World!</h1>'))

and therefore more complicated forms or responses

[toc] | [prev] | [next] | [standalone]


#36135

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-03-19 18:23 +0100
Message-ID<fe12fcbb-bf7b-2484-c664-94ff26b749a9@PointedEars.de>
In reply to#36126
groovee@cyberdude.com wrote:
> On Sunday, 17 March 2019 20:32:45 UTC+5:30, Thomas 'PointedEars' Lahn  wrote:
>> In now 19 years of posting in Usenet under my real name I have never had any
>> problems with people in real life, 
> 
> OK, TLDR;

Of course.  Why take the time to read what others have taken time to write?
You only care about yourself.

> but - well, good for you, however it was not the case with me. I just...
> dont' *want* a lot of folks to know what I'm up to, online - is there
> anything wrong with that??

Certainly:  Usenet is the thing with *people*.

You appear to have acquired the misconception that this is a matter for
debate, and that this would be the place to debate it.  This would be wrong.
 I have given you advice on how you can increase your chances of getting an
answer to your question, a solution to your problem; not least, from me.
Take it or leave it.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36113

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2019-03-13 15:22 +0000
Message-ID<slrnq8i80v.6qm.jon+usenet@sable.unequivocal.eu>
In reply to#36105
On 2019-03-12, groovee@cyberdude.com <groovee@cyberdude.com> wrote:
> I think I've asked this question before over here, but it seems to
> have slipped my mind what was said - I'd like to know: is there any
> way to do server side programming in JS to generate a webpage, with
> the code bits "inserted" into the HTML bits, like <?php does for
> PHP?

I think that's what ASP does with <script runat=server>.
Also you could achieve something very similar with node.js and jsdom.

[toc] | [prev] | [next] | [standalone]


#36116

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2019-03-13 19:16 -0700
Message-ID<3e7cf907-0e16-4230-9ea5-f7629092fb62@googlegroups.com>
In reply to#36105
gro...@cyberdude.com wrote:
> Hi,
> I think I've asked this question before over here, but it seems to have slipped my mind what was said - I'd like to know: is there any way to do server side programming in JS to generate a webpage, with the code bits "inserted" into the HTML bits, like <?php does for PHP? Otherwise, how would you say, print stuff from a MySQL database (assuming you're using node.js) on a webpage? You'd need some way to separately print the MySQL data, and *then* (if it comes afterwards) print the rest of the HTML. Ugh! This is Horrifying! Surely there must be a better solution?

Just use express:

<https://expressjs.com/>

[toc] | [prev] | [next] | [standalone]


#36118

Fromgroovee@cyberdude.com
Date2019-03-14 07:00 -0700
Message-ID<008e933d-9925-4969-bb63-9fb0df9727bf@googlegroups.com>
In reply to#36116
On Thursday, 14 March 2019 07:46:52 UTC+5:30, Michael Haufe (TNO)  wrote:
> gro...@cyberdude.com wrote:
> > Hi,
> > I think I've asked this question before over here, but it seems to have slipped my mind what was said - I'd like to know: is there any way to do server side programming in JS to generate a webpage, with the code bits "inserted" into the HTML bits, like <?php does for PHP? Otherwise, how would you say, print stuff from a MySQL database (assuming you're using node.js) on a webpage? You'd need some way to separately print the MySQL data, and *then* (if it comes afterwards) print the rest of the HTML. Ugh! This is Horrifying! Surely there must be a better solution?
> 
> Just use express:
> 
> <https://expressjs.com/>

Thanks muchly for that Michael, this looks very interesting indeed! But there's quite a bit of stuff to wade through on that site - would it be asking too much for you to post just a snip of code showing me how to use ExpressJS to intersperse HTML with Javascript code?? :) (my head is kind of spinning reading all that stuff about "template engines" and whatnot on that site - I'm still not *that* adept at JS yet... :) (what's a "template engine", exactly?))
Thanks again for your help.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web