r/shittyprogramming • • Dec 06 '17

Server-side JavaScript code?

Hi I'm trying to make Server-sided JavaScript code. Can Someone help me?

4 Upvotes

16 comments sorted by

View all comments

46

u/[deleted] Dec 06 '17

Dude. ASP.NET has been doing this for years. Just add the runat attribute to the script tag.

<script runat="server"> // Put code here </script>

Just be careful to not use alert(), otherwise someone will have to log into the server to click "OK".

Good luck!

9

u/xhable Dec 06 '17

You joke, we had a legacy asp.net web forms app at my company that was filled with messageboxes for debugging. The server was filled with boxes saying "I'm here" or "X is 27". Hilarious if not depressing.

0

u/[deleted] Dec 06 '17

[deleted]

2

u/xhable Dec 06 '17

Long gone usefully!