[英]How can i get the code of script file?
We are developing a web based application. 我们正在开发基于Web的应用程序。 In this we want to hide a script files from browser's page source.
在此,我们想从浏览器的页面源中隐藏脚本文件。 After some research we are planned to push the script files dynamically on browser page load, and also after page loaded we empty the source of the script files.
经过一些研究,我们计划在浏览器页面加载时动态推送脚本文件,并且在页面加载之后,我们清空脚本文件的源。 By using this method we are hide the script files from browser's page source.Is there any other method to get the script files.
通过使用这种方法,我们从浏览器的页面源中隐藏了脚本文件,是否还有其他方法可以获取脚本文件。
Instead of inline javascript you can use external files . 可以使用外部文件来代替内联JavaScript 。 Your code will not be in the page you are viewing, but in another file.
您的代码将不在您正在查看的页面中,而是在另一个文件中。 Of course it's not hidden from the browser.
当然,它不会从浏览器中隐藏。
Example for inline javascript: 内联javascript的示例:
<!-- index.html -->
<body>
<script type="text/javascript">
alert("my super secret js!");
</script>
</body>
Example for external file javascript: 外部文件javascript的示例:
<!-- index.html -->
<head>
<script type="text/javascript" src="your_js_file.js"></script>
</head>
/* your_js_file.js */
alert("my super secret js!");
Simple! 简单! If you see source like :
<script type="text/javascript" src="xyz.js"></script>
in the browser's sorce window , then click on it and it will show you your javascript code! 如果在浏览器的源窗口中看到类似
<script type="text/javascript" src="xyz.js"></script>
的源,请单击它,它将显示您的javascript代码!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.