简体   繁体   English

如何隐藏网站资产,例如js和CSS文件?

[英]how to hide website assets such as js and css files?

I came across the following index.html page in which i didn't find any custom assets, such as js and css files. 我遇到了以下index.html页面,在其中没有找到任何自定义资产,例如js和css文件。 The assets path is as follows 资产路径如下

在此处输入图片说明

I am not able to find where we have included assets/css/custom/.css assets/js/custom/.js files. 我找不到包含资产/css/custom/.css资产/js/custom/.js文件的位置。

Is there a way to hide these css and js file from html code? 有没有办法从HTML代码隐藏这些CSS和JS文件?

<!DOCTYPE html>
<html ng-app="App">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Where passion meets potential</title>
</head>

    <body>
        <!-- start of loading jquery -->
        <script src="assets/js/vendor/jquery/jquery.min.js"></script>
        <script src="assets/js/vendor/lazyload/lazyload.js"></script>
        <!-- Loading angular and angular route via CDN -->
        <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
        <script src="//cdn.firebase.com/js/client/2.2.4/firebase.js"></script>
        <script src="//cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js"></script>
        <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/ngStorage/0.3.6/ngStorage.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.8/angular-filter.min.js"></script>

        <!-- Loading Angular Controller -->
        <script src="controller.js"></script>

        <!-- using lazyload to load our dependencies programatically -->
        <script src="assets/js/vendor/lazyload/application-css.js"></script>
        <script src="assets/js/vendor/lazyload/application-js.js"></script>

        <!-- Main Content -->
        <div id="main">
            <!-- angular template injection-->
            <div ng-view></div>
        </div>
        <!-- END Content -->

    </body>
</html>

Just read the comments. 只需阅读评论。 A library called lazyload is used to load all dependencies, probably from the folders you named. 名为lazyload的库用于加载所有依赖关系,可能是从您命名的文件夹中加载。

<!-- using lazyload to load our dependencies programatically -->
<script src="assets/js/vendor/lazyload/application-css.js"></script>
<script src="assets/js/vendor/lazyload/application-js.js"></script>

I don't know how it works exactly but I assume it will add the lazily loaded files somewhere to the DOM. 我不知道它是如何工作的,但是我认为它将延迟加载的文件添加到DOM中。 The client will always be able to find those resources somehow (eg the network tab of chrome devtools). 客户端将始终能够以某种方式找到那些资源(例如chrome devtools的网络标签)。 The files in the code above will probably contain information about how it works for your project. 上面的代码中的文件可能包含有关其在项目中的工作方式的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 图像资源可用于 CSS 文件而不是 JS 文件——为什么? - Image assets available to CSS files but not JS files -- why? 如何组织css和js文件的缩小和打包以加快网站速度? - How to organize minification and packaging of css and js files to speed up website? 如何防止Wordpress插件资产(css和js文件)加载到所有页面上 - How do I prevent wordpress plugin assets (css and js files) to load on all pages 从Android WebView中的Assets文件夹加载CSS和JS文件 - Load CSS and JS files from assets folder in android webview 使用一些生成的密钥将js / css文件最小化为资产的方法 - Methods to minify js/css files into assets with some generated key 动态资产网址(html 文档中的 .js 和 .css 文件) - dynamic assets urls (.js and .css files in html document) 带有多种字体,js和css文件的Javascript Angular 4 Adding Assets文件夹 - Javascript Angular 4 Adding Assets folder with multiple fonts, js and css files 压缩网站上的html,css和js文件 - Compression of html, css and js files on a website 网站优化-压缩.JS / .CSS文件 - Website Optimization - Compactation of .JS/.CSS files 按下网站即可压缩.js和.css文件 - compressing .js and .css files on push of the website
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM