Is there a way to run javascripts at server just like asp that ables you to run it at server? I want my javascript not to be shown in public (by means of view source in browsers). Thanks.
There is no way to protect client-side JavaScript. If you want ANY JavaScript to run on the client for client-side functionality, then you'll have to be resigned to that fact. Of course there are ways to obfuscate the code, and putting a link to the source file stops the code from appearing inline in the actual source of the page, but the JavaScript is available via a temp folder anyway, since it has to be on the client to run (this folder would be the temporary internet files folder in Windows).
Running JavaScript on the server is just that -- running it on the server. You'd need to write to an API that accepts JavaScript as a language for that API, like ASP, which you mentioned. This server-side code has nothing to do with any client-side JavaScript, though.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.