0
這是Internet Explorer特有的。由於某些原因,我無法使用console.log
。我正在尋找一個簡單的ActiveX對象,對於腳本來說是安全的,這將允許我記錄JavaScript的調試輸出,以便用優秀的DbgView tool進行查看。該對象應該使用OutputDebugString。執行OutputDebugString的ActiveX/COM對象用於JavaScript的IE瀏覽器
然後,我可以簡單地使用這樣的:
<script>
function debugLog(str)
{
if (window.debugLogAx === undefined) {
try { window.debugLogAx = new ActiveXObject("IEDebugTools.Logger"); }
catch(e) { window.debugLogAx = null; }
}
if (window.debugLogAx !== null)
window.debugLogAx.OutputDebugString(str);
}
debugLog("Hello to DbgView from JavaScript!");
</script>
難道這樣的事情存在?
是的,這很容易,但我需要創建一個安裝程序包,獲取代碼簽名證書,簽署它 - 所有之前,我可以將其交給我需要排除故障的客戶端設施。認爲像這樣的東西可能已經存在,因爲它聽起來像是一個方便的工具。 – avo