简体   繁体   English

页面源可以包含JavaScript内容吗?

[英]Can a Page Source include JavaScript contents?

Is there a way to view whole content of javascript file in a normal page source? 有没有办法在普通页面源中查看javascript文件的全部内容? My javascipt file consists of many links which i want to be visible when i do a normal page source? 我的javascipt文件包含许多链接,当我执行正常的页面源代码时,这些链接都希望可见吗? can anyone please suggest a way how i could achieve it? 任何人都可以提出一种我可以实现它的方法吗?

Well, for one, you can just embed the script in the page. 好吧,您只需将脚本嵌入页面即可。

Instead of <script src="abc.js"></script> , do: 代替<script src="abc.js"></script> ,执行以下操作:

<script>
//Full contents of abc.js here
</script>

I don't see why you'd want to do that, though. 不过,我不明白您为什么要这么做。 Most developer tools are sufficiently advanced that you get a list of included scripts to inspect on the side (for example, the "sources" tab in the Chrome dev tools) 大多数开发人员工具都具有足够的高级功能,因此您可以在其中获取要检查的包含脚本的列表(例如,Chrome开发人员工具中的“来源”标签)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM