問題描述
我有一個顯示 SVG 圖形的圖形頁面.我正在使用 Raphael 圖形框架.該頁面在 Firefox 中正確顯示,此外,如果 F12 開發人員工具在 IE9 中設置為打開",則它可以正常工作.如果 F12 開發者模式關閉并且應用程序在清除瀏覽器緩存的情況下啟動(模擬普通用戶),則該地圖顯示 IE9 中的部分數據(它是一個節點鏈接圖,它僅顯示 12 個節點中的一個子節點).
I have a graphics page which shows SVG graphics. I am using Raphael graphics framework. The page displays properly in Firefox, Also if the F12 developer tools is set 'on' in IE9 it works fine. The map show partial data (its a node link diagram and it shows only one child node out of 12 nodes) in IE9 if the F12 developer mode is set off and application is started with browser cache cleared (simulating a general user).
更新:我保持??調試器打開并顯示錯誤控制臺未定義".所以我認為這不是圖形渲染問題,而且我沒有明確使用控制臺,也許思維導圖js在內部使用它,但是如何再次擺脫這個問題?
Update: I kept the Debugger on and Shows me the error "Console is undefined". So I think its not a graphics rendering issue, and also I am not using the console explicitly, maybe the mindmap js is using it internally, but how to again get rid of this issue?
更新:我發現了問題并注釋掉了 js 文件中的 console.log 條目.
Update: I found the issue and commented out the console.log entries from the js files.
謝謝.
推薦答案
可能您的代碼或您正在調用的代碼正在使用 console.log
或類似的東西.
Probably your code or the code you are calling is using console.log
or something like it.
您可以在全局范圍內添加此代碼來為 IE(或任何不支持它的瀏覽器)創建一個虛擬包裝器.在調用任何其他庫之前,只需將以下代碼放在某處:
You could add this code in the global scope to create a dummy wrapper for IE (or any browser that doesn't support it). Just put the following code somewhere before you call any other libraries:
if(!(window.console && console.log)) {
console = {
log: function(){},
debug: function(){},
info: function(){},
warn: function(){},
error: function(){}
};
}
這篇關于IE9 中的控制臺未定義錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!