Removed IE 8 support, slimmed event module, updated README

This commit is contained in:
Timothy Warren 2011-06-28 20:38:47 -04:00
parent 0fca7435f7
commit ae0ca88cc2
2 changed files with 19 additions and 39 deletions

View File

@ -4,7 +4,7 @@ A Minimal, Modular Javascript library for Modern browsers.
Aims to be fast, small, and easily split into individual modules. Aims to be fast, small, and easily split into individual modules.
Browser support: IE8+, Latest versions of Firefox, Chrome, Safari, Opera Browser support: IE9+, Latest versions of Firefox, Chrome, Safari, Opera
## Basic Use: ## ## Basic Use: ##

30
kis.js
View File

@ -57,9 +57,9 @@
var ajax = { var ajax = {
_req: function() _req: function()
{ {
return (window.XMLHttpRequest) return (typeof window.XMLHttpRequest === "function")
? new XMLHttpRequest() ? new XMLHttpRequest()
: new ActiveXObject("Microsoft.XMLHTTP"); : false;
}, },
_do: function(url, data, callback, isPost) _do: function(url, data, callback, isPost)
{ {
@ -267,11 +267,10 @@
(function(){ (function(){
var attach, remove, add_remove, e; var attach, remove, add_remove, e;
if(document.addEventListener)
{
attach = function(sel, event, callback) attach = function(sel, event, callback)
{ {
if(sel.addEventListener) if(typeof sel.addEventListener === "function")
{ {
sel.addEventListener(event, callback, false); sel.addEventListener(event, callback, false);
} }
@ -279,30 +278,11 @@
remove = function(sel, event, callback) remove = function(sel, event, callback)
{ {
if(sel.removeEventListener) if(typeof sel.removeEventListener === "function")
{ {
sel.removeEventListener(event, callback, false); sel.removeEventListener(event, callback, false);
} }
}; };
}
else
{
attach = function(sel, event, callback)
{
if(sel.attachEvent)
{
sel.attachEvent("on"+event, callback);
}
};
remove = function(sel, event, callback)
{
if(sel.detachEvent)
{
sel.detachEvent("on"+event, callback);
}
};
}
add_remove = function (sel, event, callback, add) add_remove = function (sel, event, callback, add)
{ {