JavaScript alert not working in Firefox 6

前端 未结 3 1831
小鲜肉
小鲜肉 2020-11-29 06:01

I tried running this JavaScript code in the address bar in Firefox 6:

javascript:alert(\"Hello\")

I get a

Referenc

3条回答
  •  误落风尘
    2020-11-29 06:30

    Felix's answer correctly states why javascript: in the URL bar doesn't work any more.

    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.

提交回复
热议问题