Simple question, and I'm sure it's being asked a number of times already!
How can I prevent a link to my JS file being clicked on in my source code?
I'm creating an Angular JS SPA website and have resolve in action already, so it's virtually impossible to access links by appending the url as it will always bounce back to the home page, which is what I want.
However, I need to hide my src code and have numerous ways of doing this already but simply want to prevent the link in the source code from being 'clickable'.
I have managed to do it like this for my CSS (Google method), which is similar to what I want:
<script type="text/javascript" defer="defer">
var cb = function() {
var l = document.createElement('link'); l.rel = 'stylesheet';
l.href = 'stylesheets/style.css';
var h = document.getElementsByTagName('head')[0];
h.parentNode.insertBefore(l, h);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
if (raf) raf(cb);
else window.addEventListener('load', cb);
</script>