How to upload my calculation code to my website with the html/javascript hidden?

52 Views Asked by At

I am a new/self-taught coder. I coded a way to calculate complex data based on inputs and give result using Visual Studio Code with html and javascript. Right now I have the file saved as index.html on my laptop and I access the code through the "Go Live" feature on the app with chrome. I want to upload this code to my website through a login for a user. I am very concerned that someone will be able to view the page source and steal my code after they login. What steps do I need to take to upload this code to my website and protect the code from theft.

In summary I would like to:

  • create a login page on my website
  • upload my html/java code on the landing page once logged in
  • make the java code hidden/encrypted/unaccessible

My website has wordpress and cPanel.

1

There are 1 best solutions below

0
Greenreader9 On

HTML, CSS, and JavaScript are all client-side languages. That means that the browser directly interprets them. Therefore, there is no way to hide them from the user. What you can do is switch to a language such as PHP, which the server interprets and is not visible to your visitors (Instead the compiled HTML code is). HTML, CSS, and JavaScript can technically be called "Open Source" since they will always be visible.

Just think. If you could hide these languages from the user, Google, Microsoft, and all the other big companies certainly would, then no one would be able to duplicate them at all (Unless they re-invent it).

Also, why did you set "java" as a tag? That's a completely different language.