You can't, sorry. No matter what you do, even if you could keep people from being able to view source, users can alway use curl or any similar tool to access the JavaScript manually.

Try a JavaScript minifier or obfuscator if you want to make it harder for people to read your code. A minifier is a good idea anyhow, since it will make your download smaller and your page load faster. An obfuscator might provide a little bit more obfuscation, but probably isn't worth it in the end.

hide javascript/jquery scripts from html page?
I am investigating whether the following hypergraph is $2$-colorable.

Let $0\le c &lt; d &lt; e$ be fixed natural numbers and consider a graph on $2e$ vertices, with the vertices labelled as $0,1,\cdots 2e-1$. For every vertex $u$, whenever $u+x-y$ and $u+z-y$ make sense as a vertex and $x,y,z$ are such that $\{x,y,z\}=\{c,d,e\}$, there is a hyperedge $\{u,u+x-y,u+z-y\}$. Is this graph $2$-colorable? If so, how can I construct a $2$-coloring?

I'll be grateful for any suggestions or comments.
