I tried running this JavaScript code in the address bar in Firefox 6:
javascript:alert("Hello")
I get a
ReferenceError: alert not defined.
It used to work fine in Firefox 5 though, and still works on Opera, Safari and Chrome. How do I fix this?
|
I tried running this JavaScript code in the address bar in Firefox 6:
I get a
It used to work fine in Firefox 5 though, and still works on Opera, Safari and Chrome. How do I fix this?
| |||||
feedback
|
|
It seems using
And this is the "bug" that was resolved in the latest version. The last comment also states:
Now:
You can't, you have to wait until they decided for a proper solution. As the comment said, bookmarklets will work, but must be explicitly allowed. If you just want to test code, use either Firebug or the new Scratchpad feature. | |||||||||||||||
feedback
|
|
Felix's answer correctly states why The replacement for this, if you're trying to debug your web page, is the Web Console (not to be confused with the Error Console). In the compact menu, it's under Web Developer; in the full menu bar, it's under Tools. Or you can press ctrl-shift-K (cmd-shift-K on macs). The bar with a greater-than sign is a JavaScript prompt; code entered there will be evaluated in the context of the current page. Anything in the area above that bar that's underlined can be clicked on to bring up an inspector window. | |||||||
feedback
|
|
If your clickable bookmarklet got broken and you want it back, you can create a clickable button instead using Custom Buttons Firefox extension. The advantages of button over running from Scratchpad:
The extension is a bit special because the buttons run at Firefox chrome level, so they're a bit more privileged (you can interact with the browser's API), and there's no 1-to-1 correspondence between normal JS and the button code (it needs some tweaking). More precisely, However, you can assign the 'good' Here's a sample code I written which works pretty well in Fx10:
Instead of using global functions directly (like To add a button, right click on any button you already have and choose 'Add new button...'. | ||||
|
feedback
|