Can you hide you javascript through loading it through ajax?

Jim

New member
I am no expert but i think ajax loads your js from a server and injects it into the page at run-time is there any way to load your js but hide it at the same time, that woulnd't realy make sense though thinking about it.

Basically can you run your js from server side using ajax or some other method and hence hide it from client side users?
 
You can do this by simply externalizing your JavaScript, first by coding in an external file, then link the external file to the one you want it used on.

AJAX (Asynchronous JavaScript and XML) is used to load info onto a page without having to refresh. For example, let's say you're trying to register at a Website, but the username you're trying to register with is already taken.

By conventional means, you'd have to click the Submit button, only to see the page refresh with an error message. However, with AJAX, you can use a username checker on the same page, which alerts you that the username is already taken, without having to refresh the page.
 
Back
Top