IE9 中設置 `window.status = '提示信息'` 狀態欄無任何反應,刷新也無效。
瀏覽器安全機制禁止腳本修改狀態欄文本。這是為了防止惡意網站欺騙用戶(如偽造安全鎖圖標、誤導性鏈接地址)。
即使啟用,部分 IE 版本仍不生效,且用戶環境不可控。
<div id="status-bar" class="fixed-bottom p-2 bg-light border-top"></div>
<script>
function setStatus(msg) {
document.getElementById('status-bar').textContent = msg;
}
</script>
// 使用成熟庫如 toastr, sweetalert2, element-ui 的 Message
toastr.info('操作提示信息');
// 頁面標題提示
document.title = '新消息 (3) - 系統標題';
// Console 輸出(開發調試用)
console.log('狀態信息:', msg);
`window.status` 是被廢棄的歷史遺留 API,現代 Web 開發應完全避免使用,改用頁面內自定義 UI 組件提供用戶反饋。