问题描述
我试图在Firebug控制台中测试某些内容,出于某种原因,我无法使用 getElementByTagName('脚本)在HTML页面上创建一组脚本标记')
方法。我知道我可能忽略了一些愚蠢的东西。
这是虚拟的HTML页面:
< HTML>
< head>
< title>随机Crapolla页面< /标题>
< h1>随机Crapolla页面< / h1>
< / head>
< body>
< div id =whyNot>
< p id =p1>
< a href =http://google.com>以下是连结一个< / a>< br />
< a href =http://google.com>哦poop这是另一个< / a>< br />
< a href =http://google.com>以及第三次评估< / a>< br />
< / p>
< a id =p2>
拉丁语。拉丁。拉丁...< br />
Lorem ipsum dolor sit amet,consectetur adipisicing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua。请将您的评论发送给我们,我们会尽快为您解答。 Duis aute irure dolor in renhenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur。 Excepteur sint occaecat cupidatat non proident,sunt in culpa qui officia deserunt mollit anim id est laborum
< / p>
< / div>
< script type =text / javascriptsrc =itDoesntExist.js>< / script>
< script type =text / javascriptsrc =dummyJSnumeroDos.js>< / script>
< / body>
这就是我'输入Firebug控制台:
var scripts = document.getElementsByTagName('script');
console.log(scripts);
//i.stack.imgur.com/AR5l8.pngalt =在这里输入图片描述>
选择 info ,它只会显示信息。点击全部按钮!
为了表明它有所不同,新的截图
I am trying to test something, and for one reason or another, while working in the Firebug console, I am unable to create an array of script tags on the HTML page using the getElementByTagName('script')
method. I realize there is probably something stupid I am overlooking.
This is the dummy HTML page:
<html>
<head>
<title>Random Crapolla Page</title>
<h1>Random Crapolla Page</h1>
</head>
<body>
<div id="whyNot">
<p id="p1">
<a href="http://google.com">Here is link one</a><br />
<a href="http://google.com">Oh poop here's another</a><br />
<a href="http://google.com">And a 3rd for good measure</a><br />
</p>
<a id="p2">
Latin. Latin. Latin...<br />
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
</p>
</div>
<!-- Script tag testing-->
<script type="text/javascript" src="itDoesntExist.js"></script>
<script type="text/javascript" src="dummyJSnumeroDos.js"></script>
</body>
And this is what I'm typing into the Firebug console:
var scripts = document.getElementsByTagName('script');
console.log(scripts);
All selected in Console
You have info selected, it will only show info. Click the All button!
And to show that it makes a difference, new screenshots
这篇关于Firebug控制台:不显示console.log的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!