termi / es5-dom-shim Goto Github PK
View Code? Open in Web Editor NEWLightweight ES5 and DOM shim with IE6 and IE7 support
Lightweight ES5 and DOM shim with IE6 and IE7 support
MDSN:
getAttribute method
setAttribute method
removeAttribute method
For resolve problems with properties and attributes in IE < 8, we can use second parameter in [get/remove]Attribute and third parameter in setAttribute.
var div = document.createElement("div");
div.testValue = 666;
div.setAttribute("testValue", "lolcat");
console.log("property value: " + div.testValue, " ", "attribute value: " + div.getAttribute("testValue"));
div.testValue = 666;
div.setAttribute("TESTVALUE", "lolcat", 1);
console.log("property value: " + div.testValue, " ", "attribute value: " + div.getAttribute("TESTVALUE", 1));
Hi, I always get an error in IE8 in shivedCreateElement function (https://github.com/termi/ES5-DOM-SHIM/blob/0.7/__SRC/a.ie8.js, l:2115) saying that this["orig__createElement"] is null.
I changed this["orig__createElement"] to document["orig__createElement"] and now it works for me.
[].find(function () {}) → undefined
сейчас возвращает -1
if your doing an xhr2 shim
please make it a standalone module like with DelegateListener
If you include a.js and run this code:
var myNumber = 42,
myString = "42",
myArray = [41, 42, 43],
myBoolean = true,
myDate = new Date();
console.log(typeof myNumber);
console.log(typeof myString);
console.log(typeof myArray);
console.log(typeof myBoolean);
console.log(typeof myDate);
console.log(myNumber.constructor);
console.log(myString.constructor);
console.log(myArray.constructor);
console.log(myBoolean.constructor);
console.log(myDate.constructor);
if (myArray.constructor == Array) {
console.log("We found an array");
}
Then console.log(myDate.constructor); logs:
null
Running the code without the library logs:
Date()
What is causing this and how can it be overcome?
https://bugzilla.mozilla.org/show_bug.cgi?id=428229
"node.addEventListener("event", function)" throw Error in FF 3.6
shim doesn't work
Object.getOwnPropertyDescriptor(KeyboardEvent.prototype, "location")
throw Error: Illegal operation on WrappedNative prototype object
Object.getOwnPropertyDescriptor(document.__proto__, "firstChild")
throw Error: Could not convert JavaScript argument
After the first call to this lookupGetter, function Object.getOwnPropertyDescriptor begins to work.
KeyboardEvent.prototype.__lookupGetter__("location");
Object.getOwnPropertyDescriptor(KeyboardEvent.prototype, "location");
document.__proto__.__lookupGetter__("firstChild");
Object.getOwnPropertyDescriptor(document.__proto__, "firstChild");
defineProperty
при попытке добавить свойство remove
для HTMLSelectElement.prototype
выбрасывает исключение: «can not redefine property».
Тестировал на следующих устройствах устройствах: Samsung Galaxy Ace GT-5830 (Android 2.3.3) и HTC Wildfire (Android 2.3.5).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.