Javascript 什么会导致 firebug 中出现持续的“重新加载页面以获取源代码”错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8486165/
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-08-24 06:11:33  来源:igfitidea点击:

What can cause a persistent "Reload the page to get source for" error in firebug?

javascriptfirefoxfirebug

提问by ripper234

I'm trying to debug the javascript of a specific page, and I keep seeing

我正在尝试调试特定页面的 javascript,但我一直看到

Reload the page to get source for page.htmin Firebug.

Reload the page to get source for page.htm在萤火虫中。

On Chrome, I'm mostly able to debug the js, but sometimes I also get a blank page. What can cause such issues?

在 Chrome 上,我主要能够调试 js,但有时我也会得到一个空白页面。什么会导致这些问题?

I believe I always see a blank page in Chrome if I reload while the JS console is open. If I open a new Chrome tab, load the page, and then open the JS console, everything is ok.

我相信如果在 JS 控制台打开时重新加载,我总是会在 Chrome 中看到一个空白页面。如果我打开一个新的 Chrome 标签页,加载页面,然后打开 JS 控制台,则一切正常。

The page I'm debugging is on a localhost server (Play Framework server), although I have seen this on other pages occasionally. This only happens with inline javascript ... js that is linked from the page is displayed fine.

我正在调试的页面位于本地主机服务器(Play Framework 服务器)上,尽管我偶尔会在其他页面上看到它。这只发生在内联 javascript 中……从页面链接的 js 显示正常。

采纳答案by Adil Malik

With firebug icon, you'll see a dropdown arrow. Click that arrow to open up the drop down menu.

使用萤火虫图标,您会看到一个下拉箭头。单击该箭头以打开下拉菜单。

enter image description here

在此处输入图片说明

Click Clear Activation List.

单击清除激活列表。

Refresh the page now.

立即刷新页面。

Now under script tab you'd see the Reload link. Click that to reload the page again. This time when the page reloads, you'd see the script.

现在在脚本选项卡下,您会看到重新加载链接。单击它以再次重新加载页面。这次当页面重新加载时,您会看到脚本。

回答by florinszilagyi

I have tried all the answers described here, but for me the issue was something else.

我已经尝试了这里描述的所有答案,但对我来说问题是别的。

I got the same message "Reload to see all sources" in firebug, and the Chrome debugger didn't display anything in the sources tab as well. I saw that the debugger was working on other pages for my website, so the problem was the page itself and after hours of sequentially deleting everything I had in the page, all that remained was an 'img' tag.

我在 firebug 中收到相同的消息“重新加载以查看所有源”,Chrome 调试器也没有在源选项卡中显示任何内容。我看到调试器正在处理我网站的其他页面,所以问题出在页面本身上,在连续删除页面中的所有内容数小时后,剩下的只是一个“img”标签。

    <img src="#" />

It seems the src attribute should not contain "#", perhaps someone with a deeper understanding of HTML could explain this, but removing it has solved the problem for me.

似乎 src 属性不应该包含“#”,也许对 HTML 有更深入了解的人可以解释这一点,但删除它已经为我解决了问题。

Hopefully this will be of use to someone else as well.

希望这对其他人也有用。

回答by Joshua Jarman

I had the same issue, but had simply overlooked one obvious thing.

我有同样的问题,但只是忽略了一件显而易见的事情。

I had the noScriptFirefox extension installed and hadn't enabled scripts from all the sources on the page, and it was blocking and causing that exact message persistently.

noScript安装了Firefox 扩展,但没有启用页面上所有来源的脚本,它一直在阻止并导致该确切消息。

回答by robsch

This might help anyone who has encountered this message too.

这也可能对遇到此消息的任何人有所帮助。

I had this message too and could not get what the problem was. But then I had found it: My problem was that I hade some urls in an jQuery Ajax call that were just the ones from the hosting provider, not the actual domain name. With those urls all was fine during development. Then, after launching, the site was accessed by the new domain name. The mixture of the urls was the problem.

我也收到了这条消息,但不知道问题出在哪里。但后来我发现了它:我的问题是我在 jQuery Ajax 调用中包含了一些来自托管服务提供商的 url,而不是实际的域名。有了这些网址,在开发过程中一切都很好。然后,在启动后,该站点被新域名访问。网址的混合是问题所在。

Strange was also that the GET url that was called via Ajax has worked in the regular browser url bar. Only in JS it did not work. Seems that I still have a knowledge deficit...

奇怪的是,通过 Ajax 调用的 GET url 在常规浏览器 url 栏中有效。只有在 JS 中它不起作用。看来我还是有知识不足...

回答by supersuphot

I have this problem once.
the solve for me is the host name

我有一次这个问题。
对我来说解决的是主机名

page url: http://localhost
request url: http://192.168.0.1

页面网址:http://localhost
请求网址:http://192.168.0.1

回答by Salaros

You have 2 possibilities:

你有两种可能:

回答by Farshid Zaker

It may also be due to "302 Moved Temporarily" error. You can check it in firebug's Net tab.

这也可能是由于“302 临时移动”错误。您可以在 firebug 的 Net 选项卡中查看它。

回答by dat

One other potential cause of the “Reload the page to get source for” message is the server returning an empty response. Check the response headers for Content-Length:0. If this isn't what you anticipated for the response, it is probably time to do some debugging on the server side of things. Note that empty responses do not alwayscause the "Reload the page to get source for" message -- however, I encountered at least one situation where this was the underlying problem.

“重新加载页面以获取源”消息的另一个潜在原因是服务器返回空响应。检查响应标头Content-Length:0. 如果这不是您对响应的预期,那么可能是时候在服务器端进行一些调试了。请注意,空响应并不总是会导致“重新加载页面以获取源”消息——但是,我至少遇到过一种情况,这是潜在的问题。

回答by Amalgovinus

For the record, this can also happen if the certificate is Hymaned for https://www.xyz.com. You need to visit that site first and add a security exception.

作为记录,如果证书被劫持到https://www.xyz.com,也会发生这种情况。您需要先访问该站点并添加安全例外。

回答by Jenny O'Reilly

I got this message displayed while opening a page that had a content-encoding error. The page returned gzip compressed data, but a HTTP module corrupted the gzip content.

我在打开存在内容编码错误的页面时显示此消息。该页面返回 gzip 压缩数据,但 HTTP 模块损坏了 gzip 内容。