搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Page source is sometimes incomplete

  • 5 回覆
  • 1 有這個問題
  • 15 次檢視
  • 最近回覆由 dhlevin

more options

Here's how I discovered this issue.

PayPal has a page on which the user selects a method for having money withdrawn from one's PayPal account to one's bank. I've found that this page's "Next" button works correctly (that is, it loads the page on which the user would then indicate the amount to be transferred) on Firefox 40.0.2, but it works incorrectly (that is, it only underlines the word "Next" and does not load a new page) on Firefox 52.9.0 and Firefox 87.0.2. (My internet access in each case is dialup.)

After pursuing various leads on the possible cause, it occurred to me to inspect the page source for the "withdraw" page for each of those versions of Firefox. And I discovered that the page source displayed by Firefox 40.0.2 contained content that was absent from the page source displayed by either of the other two Firefox versions. Some of this content appeared to define a function that returns content to the server when "Next" was clicked. If true, this could certainly account for why clicking the button didn't do what it should.

I noticed that the page source uses as many as 12 nested levels of <div>-</div> elements, which seems counter to the advice I read at an HTML standards page (at whatwg.org). But I don't know whether this could be a factor in the behavior I described.

I've copied the page source for each Firefox version and pasted them into text files, but I wasn't sure it would be appropriate to post them publicly. I would be glad to provide them offline.

Thanks for any help or suggestions.

由 cor-el 於 修改

所有回覆 (5)

more options

Clarification: the 12 nested levels were of the "div" element (which got suppressed in my comment because I incautiously used angle brackets around open and close "div" tags).

有幫助嗎?

more options

Firefox can have a problem with elements like DIV when they are nested too deeply, but 20 shouldn't be a problem.

Note that best is to use the Inspector (right-click -> Inspect Element) and not "View Page Source" because the latter shows the page as requested from the server and the former shows the current page code that might have been modified by JavaScript, so in your case the missing code is probably added via JavaScript.

有幫助嗎?

more options

Thanks for the tip on Inspect Element, which I will add to my toolbox.

However, I should probably clarify that although the code in question was absent from the page source in Firefox 87.0.2 and Firefox 52.9.0, it was present in the page source in Firefox 40.0.2 (which is what I find so baffling).

有幫助嗎?

more options

It is possible that with such an old Firefox 40 version the website assumes that its JavaScript isn't working and thus sends a simpler page to have at least some support for older browsers.

有幫助嗎?

more options

I have determined beyond a reasonable doubt that (1) the page source in Firefox 87.0.2 contains nothing that is not also present in the page source for Firefox 52.9.0, and (2) the page source in Firefox 52.9.0 contains nothing that is not also present in the page source for Firefox 40.0.2. This would seem to establish that PayPal is not sending any scripts to either of the two more recent of these browsers that it is not also sending to Firefox 40.0.2.

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題