I'm new to JS and PHP and currently have a key I need to use in JavaScript; but I don't want the user to be able to view the code and see it.
I tried putting the key in PHP and echoing it for the JS variable that holds the key, but that will just print it out anyways.
How can I use the key in JavaScript without allowing users to view the source?
EDIT: I'm using an API key to get data and use that data in functions.