百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
I

ieBetter.js

> 编程语言
开源

使 ie 浏览器像 ie6~ie8 的 morden 浏览器主机一样,

792 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使 ie 浏览器像 ie6~ie8 的 morden 浏览器主机一样,

ieBetter.js

It's created for IE6-IE8.

Why need this?

Modern browsers are so powerfull. For some small project, there is no any reason to include a large JavaScript library. For example, jQuery, Kissy and so on.

So, what we need is just a JavaScript file which is created only for IE6-IE8, and make IE6-IE8 like a modern browser(Chrome, IE9+, ...).

How to use?

Simplely, include 'ieBetter.js', then just use APIs as in modern browser. For example, you can use document.querySelector to select the DOM element, and so on. The APIs that you can use see below.

document.querySelector("#id");

Because of that only IE6-IE8 need ieBetter.js. So we have to do some special deal. For Example, IE conditional comments. Like this: <!--[if lte IE 8]> <script src="ieBetter.js"></script> <![endif]-->

However, IE10+ begin to ignore conditional comments. So, for this browser, if the page is in a IE6-IE8 documentMode, ieBetter.js will be ignored. So, maybe you can try this method: if (!document.addEventListener) { // IE6~IE8 document.write('<script src="ieBetter.js"></script>'); }

Good luck for you!

APIs and Demos

So far, the APIs that has supported are:

• 选择器相关API

*.querySelector

*.querySelectorAll

*.getElementsByClassName

• 事件相关API

*.addEventListener

*.removeEventListener

*.dispatchEvent

document.createEvent

init[|Mouse|UI]Event

input

window.onhashchange

• DOM特性相关API

window.getComputedStyle

• ES5 JSON扩展

JSON.parse

JSON.stringify

• ES5 Object扩展

Object.create

Object.keys

• Date对象

Date.now

• ES5 Function扩展

Function.bind

• ES5 String扩展

String.trim

• ES5 数组方法扩展

Array.isArray

Array.forEach

Array.map

Array.filter

Array.some

Array.every

Array.indexOf

Array.lastIndexOf

Array.reduce

Array.reduceRight

You can visit API document to get more infomation: http://zhangxinxu.github.io/ieBetter.js/

Still, you can visit here for some other information.

License

The MIT License

Donate

	支付宝
	微&nbsp;&nbsp;信

Issues· 1 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言