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!

Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Learn More

Problem with javascript:alert(document.lastModified)

  • 4 svar
  • 31 har detta problem
  • 3 visningar
  • Senaste svar av 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.

Vald lösning

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:

Läs svaret i sitt sammanhang 👍 2

Alla svar (4)

more options

Vald lösning

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:

Ändrad av 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