javascript alert() 和 console.log() 在 Firefox 26 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20810794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 19:21:08  来源:igfitidea点击:

alert() and console.log() not working in Firefox 26

javascriptfirefoxalertconsole.log

提问by Kevin Pei

I feel like I'm going crazy but alert()and console.log()refuses to work anywhereon Firefox 26.

我觉得我要疯了,但alert()console.log()拒绝工作的任何位置使用Firefox 26

At first I thought it was my own website's problem, but I cannot for the life of me to get it to work via javascript:urls, Firebug, I even tried it in jsfiddle.netby just putting alert('test');in the script panel.

起初我认为这是我自己网站的问题,但我终生无法通过javascript:url让它工作Firebug,我什至在jsfiddle.net 中通过放入alert('test');脚本面板来尝试它。

Tried uninstalling and installing again, no luck.

尝试卸载并再次安装,没有运气

The only extension I'm running is Firebug.

我正在运行的唯一扩展是 Firebug。

Heck, Stackoverflow didn't even prompt me about leaving when I accidentally clicked the back button while writing this.

哎呀,当我在写这篇文章时不小心点击了后退按钮时Stackoverflow 甚至没有提示我离开

Also yes, I made sure there was some contentinside the alert()and console.log()

还不错,肯定我有一些内容内部alert()console.log()

What I mean by not working is that Firefox treats the code as if it were non-existent, nothing happens.

我所说的不工作是指 Firefox 将代码视为不存在,没有任何反应。



Once again, here's my environment:
Browser:Firefox 26.0
OS:Windows 8.1 Pro
Issue:alert(), console.log(), and apparently prompt()doesn't work

再一次,这是我的环境:
浏览器:Firefox 26.0
操作系统:Windows 8.1 Pro
问题:alert(),,console.log()显然prompt()不起作用

If anyone might know why this is happening, I would highly appreciate an answer.

如果有人可能知道为什么会发生这种情况,我将非常感谢您的回答。



UPDATE

更新

Following Pointy's comment, it appears that both alert()and console.log()work as expected on the New Tab Page, but nowhere else

继尖尖的评论,似乎都alert()console.log()工作按预期在新标签页,但无处

采纳答案by Kevin Pei

Thanks for all the help guys, in the end I used Revo Uninstallerto completely and absolutely wipe Firefox from my system, then installed it again. Seems to be working now, the original uninstaller most likely didn't remove whatever was causing the problem.

感谢所有帮助人员,最后我使用Revo Uninstaller从我的系统中彻底彻底清除了 Firefox,然后重新安装了它。现在似乎正在工作,原始卸载程序很可能没有删除导致问题的任何内容。

回答by FoggyDay

You might want to try re-installing Firebug:

您可能想尝试重新安装 Firebug:

PS: I happen to be running a similar configuration (including FF 26) ... and things work fine for me. IMHO...

PS:我碰巧正在运行类似的配置(包括 FF 26)......而且对我来说一切正常。恕我直言...

PPS: You might also try setting "about:config, prompts.tab_modal.enabled = false":

PPS:您也可以尝试设置“about:config, prompts.tab_modal.enabled = false”:

The default is "true", my FF 26 is set "true" and things are working for me ... but who knows. If reinstalling Firebug doesn't help, maybe it's worth a shot?

默认值为“true”,我的 FF 26 设置为“true”,一切对我有用……但谁知道呢。如果重新安装 Firebug 没有帮助,也许值得一试?

回答by Bhaskar Melkani

Silly but, in firebug can you check if window.alert and window.console are defined.... and if yes then, can you check if window.alert('hi') works ?

愚蠢的但是,在萤火虫中你可以检查 window.alert 和 window.console 是否被定义......如果是,那么你能检查 window.alert('hi') 是否有效吗?

回答by evgenius

I have same bug when i using Ghostery extension. Disable Ghostery and reload page. Lets check at https://getfirebug.com/tests/head/console/api/log.html

当我使用 Ghostery 扩展时,我有同样的错误。禁用 Ghostery 并重新加载页面。让我们检查https://getfirebug.com/tests/head/console/api/log.html

回答by Dumindu Lathpandura

I had a similar issue, on IE v11.0.10 and Chrome Canary v38.0.2114. Duplicate function name turnout to be the issue. Worth doing a quick check for function names in Javascript file.

我在 IE v11.0.10 和 Chrome Canary v38.0.2114 上遇到了类似的问题。重复的函数名称是问题所在。值得在 Javascript 文件中快速检查函数名称。

回答by Chip McCormick

You can use the Firefox console with CTRL + SHIFT + K

您可以通过 CTRL + SHIFT + K 使用 Firefox 控制台

Related: https://support.mozilla.org/en-US/questions/876916

相关:https: //support.mozilla.org/en-US/questions/876916