Implemented String.prototype.trim if not defined to support IE8
parent
d3953475f0
commit
54040c273e
|
@ -298,6 +298,14 @@ if(!Array.prototype.indexOf) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Need to define trim() since this is not available on older IEs,
|
||||||
|
// and trim is used in several libs
|
||||||
|
if(String.prototype.trim === undefined) {
|
||||||
|
String.prototype.trim = function () {
|
||||||
|
return H5P.trim(this);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Simple 'contains' function. Easier to use than keep testing indexOf to -1.
|
// Simple 'contains' function. Easier to use than keep testing indexOf to -1.
|
||||||
Array.prototype.contains = function (needle) {
|
Array.prototype.contains = function (needle) {
|
||||||
return (this.indexOf(needle) > -1);
|
return (this.indexOf(needle) > -1);
|
||||||
|
|
Loading…
Reference in New Issue