Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

ค้นหาฝ่ายสนับสนุน

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

href with scroll(0,0) no longer works!

  • 2 การตอบกลับ
  • 4 คนมีปัญหานี้
  • 1 ครั้งที่ดู
  • ตอบกลับล่าสุดโดย cor-el

more options

Until the update to V36.01, I used scroll(0,0) in an href as a link to the top of the page - which worked fine. It no longer works for me. Any ideas?

Until the update to V36.01, I used scroll(0,0) in an href as a link to the top of the page - which worked fine. It no longer works for me. Any ideas?

วิธีแก้ปัญหาที่เลือก

Do you mean like this:

<a href="javascript:scroll(0,0)">To Top</a>

It seems this should still be supported, per MDN: https://developer.mozilla.org/docs/Web/API/Window/scroll

Does it make any difference if you use:

<a href="javascript:window.scroll(0,0)">To Top</a>

or to separate your event handler from the HTML:

<a href="#" onclick="window.scroll(0,0); return false;">To Top</a>
อ่านคำตอบนี้ในบริบท 👍 2

การตอบกลับทั้งหมด (2)

more options

วิธีแก้ปัญหาที่เลือก

Do you mean like this:

<a href="javascript:scroll(0,0)">To Top</a>

It seems this should still be supported, per MDN: https://developer.mozilla.org/docs/Web/API/Window/scroll

Does it make any difference if you use:

<a href="javascript:window.scroll(0,0)">To Top</a>

or to separate your event handler from the HTML:

<a href="#" onclick="window.scroll(0,0); return false;">To Top</a>
more options

You could try #top instead if you only need to scroll to the top.

Did you check the Web Console (Firefox/Tools > Web Developer) for error messages?