Skip to content

Commit 06a23da

Browse files
author
Philip Guo
committed
OMG WTF Internet Explorer!!!
1 parent 223d638 commit 06a23da

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎edu-python.js‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ function assert(cond) {
6262
}
6363
}
6464

65+
// OMG WTF Internet Explorer, I HATE YOU!!!
66+
// Thanks to: http://soledadpenades.com/2007/05/17/arrayindexof-in-internet-explorer/
67+
if (!Array.indexOf) {
68+
Array.prototype.indexOf = function(obj){
69+
for(var i=0; i<this.length; i++){
70+
if(this[i]==obj){
71+
return i;
72+
}
73+
}
74+
return -1;
75+
}
76+
}
77+
6578
// taken from http://www.toao.net/32-my-htmlspecialchars-function-for-javascript
6679
function htmlspecialchars(str) {
6780
if (typeof(str) == "string") {

0 commit comments

Comments
 (0)