顯示具有 IE 標籤的文章。 顯示所有文章
顯示具有 IE 標籤的文章。 顯示所有文章

2018/10/03

[JavaScript] 解決在 IE 11 出現 'Promise' 未經定義的錯誤

又是一個遇到老瀏覽器不支援新東西的問題

自從拔掉 jQuery 的 $.ajax,改採用 axios 處理非同步資料讀取,IE 11 噴出以下訊息



在不想改變現有寫法下,找到解決的方法,直接用 Promise Polyfill。

Lightweight ES6 Promise polyfill

可以直接引用 CDN

<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>

或是下載檔案使用

實驗結果,以最快速確認可行性,就是直接引入 CDN,結果成功!還好不用再改寫法~收工,繼續下一題。

2007/04/25

[HTML] Conditional Comments

When dealing with HTML and CSS, the most difficult part is to get everything work in different browsers.

Some hack tips:
In CSS, the way I use to code for different browsers (usually IE and FF) is '!important'.
However, it seems that IE 7 understands this magic command while IE 6 doesn't. It makes more difficult to recognize IE 7 and FF.

Here is the solution: Conditional Comments
simple way to check IE version
<!--[if IE 6]>

Using Internet Explorer 6.

<![endif]-->
or check the condition: [if !IE] => for FF