Reputation: 33
Am a beginner in JQuery, while testing my web application on high-end PC (specifically say when using windows 10 setting scale and layout>change the size of text apps and other items
to 150% ) 'retina.min.js' showing some errors from following functions
Function 1
function r(e, t) {
try {
this.path = e;
if (typeof t !== "undefined" && t !== null) {
this.at_2x_path = t;
this.perform_check = false
} else {
this.at_2x_path = e.replace(/\.\w+$/, function (e) {
return "@2x" + e
});
this.perform_check = true
}
}
catch (err) {
alert("Function 1" + err.message);
}
}
error: Function 1: Cannot read property 'replace' of null
Function 2
r.prototype.check_2x_variant = function (e) {
try {
var n, i = this;
if (this.is_external()) {
return e(false)
} else if (!this.perform_check && typeof this.at_2x_path !==
"undefined" && this.at_2x_path !== null) {
return e(true)
} else if (this.at_2x_path in r.confirmed_paths) {
return e(true)
} else {
n = new XMLHttpRequest;
n.open("HEAD", this.at_2x_path);
n.onreadystatechange = function () {
if (n.readyState != 4) {
return e(false)
}
if (n.status >= 200 && n.status <= 399) {
if (t.check_mime_type) {
var s = n.getResponseHeader("Content-Type");
if (s == null || !s.match(/^image/i)) {
return e(false)
}
}
r.confirmed_paths.push(i.at_2x_path);
return e(true)
} else {
return e(false)
}
};
n.send()
}
} catch (err) {
alert("Function 5 :" + err.message);
}
};
error: Function 5: Cannot read property 'match' of null
Error Msg on browser Console
retina.min.js:1 Uncaught TypeError: Cannot read property 'replace' of null
at new r (retina.min.js:1)
at new i (retina.min.js:1)
at t.onload (retina.min.js:1)
r @ retina.min.js:1
i @ retina.min.js:1
t.onload @ retina.min.js:1
load (async)
n.init @ retina.min.js:1
(anonymous) @ retina.min.js:1
(anonymous) @ retina.min.js:1
why is this happning ?
Its a plug in and i have no idea how it is working , so i dont wanna mess it up . Please help me .. what should i change ?
Upvotes: 2
Views: 181