You would need to use what we call server side screen which basically means it reads all the script on the server and then just outputs html, this is so no one can then steal your code.
Server side scripting includes the following:
.cfm Cold Fusion - not widely used, so it may be difficult to learn
.asp Active server pages - widely used, but slowly getting phased out.
.aspx asp .net - this is the next generation of scripting
.php - I know really use this, so I can tell you much info about it.
Javascript is client side, so it can be copied by looking at the page source in your browser. Javascript does allow you to have on the fly dynamic content which is why it is used so widely
to do anything fancy you will need a combination of both.
hope this makes some sense