HTML:
<script type="text/javascript" src="scripts/js/script.js"></script>
此处为 JQuery 函数:
$(document).ready(function() {
function rnmtn(){
console.log("red");
}
});
如何在控制台中调用 rnmtn();
而不返回 undefined
- 脚本未链接到 html 对象 - 我需要它在其上运行拥有。
最佳答案
实现你的功能
function rnmtn(){
console.log("red");
}
然后在控制台输入
rnmtn()
关于javascript - 如果 JS 函数包含在 HTML 中,我如何在浏览器控制台中显示所有 JS 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40559349/