简体   繁体   English

Firefox 控制台 getElementBy 不起作用

[英]Firefox console getElementBy doesn't work

Can someone tell me why when i run谁能告诉我为什么当我跑步时

document.getElementsByTagName('img')[0]

in chrome's console shows what I want and doing the same on firefox does not?在 chrome 的控制台中显示了我想要什么,并且在 firefox 上做同样的事情没有?

After some research I found out I was doing it totally wrong as I would have to load the iframe first and then access it.经过一番研究,我发现我做错了,因为我必须先加载 iframe 然后再访问它。 I wrongly thought that this would be done automatically by the browser.我错误地认为这将由浏览器自动完成。

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

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