2011-08-21 94 views
3

Possible Duplicate:
JavaScript alert not working in Firefox 6的Javascript:警報( '...') - 錯誤:未捕獲的異常:沒有定義警報

我經常在地址欄(主要用於調試和測試)執行JavaScript代碼:的ReferenceError 的javascript:警報(some_function_with_interesting_return_value( '等等')); 或 - 更明顯: javascript:alert('interesting value');

這似乎並沒有與Firefox 6工作了: 錯誤:未捕獲的異常:的ReferenceError:警報沒有定義

怎麼可能警報()不被界定?

我已經用Firefox 5,Epiphany,Midori和Chromium進行了雙重檢查 - 工作正常。

+0

用於測試的Web控制檯或暫存。 –

回答

5

我認爲這可能是預防,因爲很多網站濫用了這一點。

FYI, I'm probably going to split this bug into multiple, short and longer term fixes.

Short term: disallow pasting of javascript: URLs into the URL bar Longer term: additionally require that bookmarklets be "whitelisted" in the Bookmark Manager before it can run JavaScript

https://bugzilla.mozilla.org/show_bug.cgi?id=527530#c6

+0

我明白了這一點,它可能是一些(罕見)案例中的(安全)問題。那麼,我可以從Scratchpad運行我的JS代碼,但是我不得不在兩個窗口之間切換。沒有辦法在地址欄中暫時允許JS? – basic6

+1

@ basic6:我恐怕現在不是這樣 – genesis

+5

我現在使用的Firebug的命令行工作完美(實際上比位置欄更好)。 – basic6