Click here to Skip to main content
15,888,088 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm currently working in Angular and HTML. I want to make my page more secure so I hide the code and content of the page for that I used Angular directive to hide the code and it's works. In that page <scripts> and tags are available I need that also hide from the page is there any possibilities for that.

What I have tried:

Javascript files

JavaScript
<script src="/Scripts/Angular.js"></script>
<script src="/Scripts/jquery-1.9.1.js"></script>
<script src="/Scripts/bootstrap.min.js"></script>


CSS files

CSS
<link href="Content/Styles.css" rel="stylesheet" />
<link href="Content/bootstrap.css" rel="stylesheet" />
Posted
Updated 30-Dec-16 0:44am
v2

You can impossibly hide scripts and styles from a user. The reason is simple: to render your page correctly, your browser needs to access these files. If your browser can access them, a user can do it too.
 
Share this answer
 
Yes, It's possible. Try this.

Script.js
JavaScript
function loadJSAtOnload() {
var scripts = [
"/Scripts/Angular.js",
"/Scripts/jquery-1.9.1.js",
"/Scripts/bootstrap.min.js",
];

for (var i = 0; i < scripts.length; i++) {
    console.log('Loading script ' + scripts[i]);
    var scriptType = document.createElement('script');
    scriptType.type = 'text/javascript';
    scriptType.src = scripts[i];
    document.body.appendChild(scriptType);  
}
};
if (window.addEventListener)
    addEventListener('load', loadJSAtOnload, false);
else if (window.attachEvent)
    window.attachEvent('onload', loadJSAtOnload);
else window.onload = loadJSAtOnload;


Style.css
CSS
@import url('Content/Styles.css');
@import url('Content/bootstrap.css');


Call the files in Main Page.
<script src="scripts.js"></script>
<link href="Style.css" rel="stylesheet" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900