搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Problem with javascript:alert(document.lastModified)

  • 4 个回答
  • 31 人有此问题
  • 3 次查看
  • 最后回复者为 esemones

more options

After I upgraded to Firefox 6.0.1 and now today to 6.0.2, I'm unable to get any response to my using javascript:alert(document.lastModified)

in order to get a web page date.
After I upgraded to Firefox 6.0.1 and now today to 6.0.2, I'm unable to get any response to my using javascript:alert(document.lastModified) in order to get a web page date.

被采纳的解决方案

Are you running that code via the location bar?

You can no longer run JavaScript code via the location bar in Firefox 6 and later.
You can see an error message in the Tools > Error Console.
That code now gets a null principal for security reasons and doesn't have any effect (Bug 656433).
You need to create a (keyword) bookmarklet and run the code by invoking that bookmark.

NoScript can allow you to run such code via the location bar, see:

定位到答案原位置 👍 2

所有回复 (4)

more options

选择的解决方案

Are you running that code via the location bar?

You can no longer run JavaScript code via the location bar in Firefox 6 and later.
You can see an error message in the Tools > Error Console.
That code now gets a null principal for security reasons and doesn't have any effect (Bug 656433).
You need to create a (keyword) bookmarklet and run the code by invoking that bookmark.

NoScript can allow you to run such code via the location bar, see:

由cor-el于修改

more options

Thanks for the guidance. When I couldn't find the "add bookmark" option, I took one of my old, unused bookmarks and severely modified its properties. Now when I enter its keyword into the location area up pops the date and time I wanted. But for the several web pages I've looked at, the date and time is always the present date and time. another problem.

more options

A lot of websites are generated dynamically by a script (e.g. PHP or other server side script) that runs on the server and in that case you will always see the current date.

more options

Thanks, again. I suspected something like that. Regards, ES