JK wrote:
I wrote a JS for a calculator and would like to prevent visitors from
seeing or copy/pasting it.
You can't. The best you could do would be to slap a reminder about copyright
law at the top, then hire a lawyer if anyone ignores it.
I have seen others that seemingly have done
this, because View Source reveals only a <href:=[website]> and no code.
Is this what is meant by Client-side/Server-side?
Client side refers to things done by the client. Server side by the server.
You could have two form fields which the user can enter numbers into. With
client side JavaScript you could ask the browser to add the numbers
together and in some way display them to the user. With server side script
the form data would be sent to your server where a script (which could be
written in JavaScript, but it isn't a popular server side language) would
generate a new HTML document with the result in it and send it back to the
client.
Server side is reliable.
Client side is fast.
Most good solutions use both, the client side to be quick and the server
side as a fall back position.
Server side programming is a big topic and largely dependant on the
capabilities of your server. Talk to your provider about what server side
scripting facilities are provided, then look for a book or website on the
subject (if they say they support CGI without specifying a language then
they probably mean Perl CGI).
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is